My Summary of : The main thread is overworked & underpaid (Chrome Dev Summit 2019)

Sukriti Sarkar
Lazy Learning
Published in
2 min readNov 19, 2019

--

I was watching: The main thread is overworked & underpaid (Chrome Dev Summit 2019)

And I thought to summarize my takeaway which can be helpful to other lazy learners.

And here the SUMMARY is:

Problems with Single Threaded Web architecture:

Everything is in Main thread. With the increasing number of next billion users, we don’t have the luxury to see Main thread extremely overworked.

Overcoming it:

With introducing some Multi threading type of stuff — like web worker.

How they have eased the developer’s work with introducing a framework type stuff — comlink — by which you need not to be worried about the conceptual part or internal part of this rather you can simply use it by importing

But still there is problem:

Workers doesn’t have access to DOM. So you can’t move just any work to them.

Another disadvantage:

Workers are not very useful in most of the UI frameworks’(Angular, Vue, React etc.) perspective as any external things you want to use there, you end up with making a component in that framework and this is the practice since the inception of web. So UI frameworks are inherently strongly tied with DOM.

So solution may be:

Separating the concerns, Off-main-thread architecture

UI threads for UI work, other works in other threads — and this is followed by PROXX from Google Chrome Labs

So you can do UI works in UI thread and other application related or computational works, which is not dependent on DOM, in App thread which can work as worker in parallel with Main thread which works on DOM.

Reference: https://youtu.be/7Rrv9qFMWNM

--

--

Sukriti Sarkar
Lazy Learning

AI Enthusiast, Thinker, R&D Lover, Backend Developer