|
|
|
|
|
by hailk
2262 days ago
|
|
Interesting. Can you elaborate on this. What do you use this vanillaJS framework for? How do you do DOM manipulation? How much traffic do you get from what you've built using this? I've heard doing document.getElement... and then modifying the DOM is costly. |
|
So, manipulating the DOM uses more memory than, say, manipulating strings.
But assuming you're going to change something on the DOM anyway, the framework has the exact same API's to manipulate the DOM that you do. And they have their own overhead to figure out what operations they want to run.
Almost by definition, vanilla will always be faster.
That doesn't mean it's always better. If you need the DOM to reflect changing states in complex ways (think Trello or Notion) I'll be the first to admit it's simpler to let someone else's algorithm morph the DOM. And that's okay.