DEV Community

Discussion on: What is the Virtual DOM? (Let's build it!)

Collapse
 
sargalias profile image
Spyros Argalias

Hey, I enjoyed the article. I also agree with the points you raised. Thanks for the good content :).

Nevertheless, I just want to point some things out that I feel are minor issues in the article.

In the first snippet of code presented. The tests don't seem fair. For the object, i is being set every time, not appended to. However, for innerHTML, i is being appended. This makes the measurement far slower. This is both because of layout thrashing, but also because the resulting string is huge (2,890 digits long). However, the main point still applies. When I tested just setting the value innerHTML, it was about 20 times slower than the operation on the object.

Also, the code snippet with the function generateList doesn't seem to work. I tried created sufficient HTML for it to run, but got a few errors.

Anyway, I still enjoyed the article overall. Keep it up :).

Collapse
 
siddharthshyniben profile image
Siddharth

I was just looking for a quick and easy way to show you stuff and I didn't actually take the time to test it too much. Thanks for pointing those out!

Collapse
 
sargalias profile image
Spyros Argalias

Yeah I gotcha. That's all good, as I said I still think it's a great article :). Yeah I was nitpicking a bit because I like actually running through the examples for more clarity :)

Thread Thread
 
siddharthshyniben profile image
Siddharth

Me too, but not on my articles 😂