DEV Community

Vani Shivanand
Vani Shivanand

Posted on

5 1

Should you ignore scripting time of virtual-dom?

In one of my post's comment section I made a statement saying,

Scripting time will be more because it was considered by any virtual-dom framework that to re-draw the tree should be optimized more than the amount of javascript that is being run.

A straight forward opinion might be to optimize scripting time is as important as it is to optimize Layout or DOM rendering. But we might want to remember web-workers here.

Workers provide multi-threading or a parallel process along with the main thread but they don't have access to DOM and other entities. As we speak about virtual-dom getting overloaded with higher scripting time, the entire operations can be moved there.

That's the reason, why the upcoming new opinion virtual-dom is not needed might not survive longer. Frameworks/libraries with virtual dom should adapt to workers.

Another issue with workers might be Structured Cloning or deep-copying which needs to be worked upon. Because to communicate between them, a huge object needs to be passed. This can be fixed by taking an input from the developer on which part of the tree might be under the scope of change. Thus reducing the tree size that is being communicated between Worker and main thread.

Thanks for reading!

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay