My FeedDiscussionsHashnode Enterprise
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Nik

75 likes

·

16.2K reads

16 comments

Sandeep Panda
Sandeep Panda
Mar 13, 2023

Great content. Welcome to Hashnode! :)

3
·
Natalia Davydova
Natalia Davydova
Apr 17, 2023

Thank you for this great article!

The only question about this part: "So, if you have transform: translateZ(0) in your codebase to move the render on a GPU, it doesn't work in such a way. It's a misconception."

Could you please share the source you've get the info?

In lots of articles is told that this 'hack' really improves optimizations.

1
·
·2 replies
Nik
Nik
Author
·Apr 17, 2023

translateZ(0) doesn't move your render to GPU. The whole "composite" layer can be executed on GPU by modern browsers.

The reason, why translateZ(0) is usually recommended to resolve some rendering issues, is because it "moves" your elements to a separate layer in browser. You can see the layers model in your browser by opening "Layers" tab:

image.png

Even though this method solves some rendering issues, many Layers might cause performance issues in your app.

If you want to learn more here is an article (rus) about that: habr.com/en/companies/odnoklassniki/articl…

1
·
Natalia Davydova
Natalia Davydova
Apr 17, 2023

Nik Thank you very much for the explanation and the article!

1
·
Nguyen Tan
Nguyen Tan
Jan 10, 2024

Great article with a super detailed explanation. I have to sign up to send a like to your content. :))

1
·
Jacob
Jacob
Jan 11, 2024

Great article!! I'd like to translate it and share it on another platform, with the original link included. May I have your permission?

1
·
·1 reply
Nik
Nik
Author
·Jan 29, 2024

Hey Jacob, sorry, missed your comment.

yes, sure, go ahead

1
·
Kaushal Joshi
Kaushal Joshi
Feb 1, 2024

Wow! Such a detailed blog. Thanks for writing :))

1
·
Nik
Nik
Author
·Mar 12, 2023

Updated images in the article. By accident got them removed before publishing the article 🙈

·
VA
VA
Apr 24, 2023

Thanks for this comprehensive article! Can I ask a question? If we mutate and read the DOM separately twice like your example, does it pause the task and run the layout step before give the result back?

·
·2 replies
Nik
Nik
Author
·Apr 28, 2023

It might not run "The whole layout", as layout is quite complicated process which has many steps, it worth to make a separate article.

What can happen: the layout of the changes code has done + recalculate all "shifting" in the elements.

The simplest way to see it:

  1. Open you browser dev tools
  2. Go to Performance Tab
  3. Start recording
  4. Open a website (or make some actions on opened page)
  5. Stop recording
  6. Open "Event log"
  7. Scroll to function call which makes Layerise step. Example: Example

  8. Select it on a timeframe to see the calculations

·
VA
VA
Apr 28, 2023

Nik Thanks for your detailed reply! Look forward to your upcoming articles about those topics like this

1
·
Zhenyu
Zhenyu
Jun 30, 2023

Thanks for this great article! Can I ask a question? if TaskQueue only has TaskA takes 4ms, TaskA call setTimeout(FuncA, 0), next step is RenderQueue or FuncA?

·
·1 reply
Nik
Nik
Author
·Jan 29, 2024

The correct answer is that behaviour is not determined. (as we should know when render happens the last time).

e.g. if the render happens right before TaskA, then there is a high probability, that FuncA will be executed before.

·
May WaM
May WaM
Sep 4, 2023

Didn't read it through yet, but someone gave me the link to #heading-what-are-microtasks and the first affirmation in this paragraph is not correct, you can queue microtasks yourself with the queueMicrotask method, and specs can queue microtasks as they will, for instance HTML does queue a microtask to update the image data of <img>, so that you can set the .crossOrigin or loading attributes after the src one, in the same task, without triggering useless network requests.

·
Abdossalam Aboasha
Abdossalam Aboasha
Feb 11, 2024

i used hashnode on coinbase wallet to connect to Tether wallet now i am getting SSL error can you help how to fix it. THanks

·