Sign in
Log inSign up
Nik

37 likes

·

3.3K reads

6 comments

Sandeep Panda Test
Sandeep Panda Test
Mar 13, 2023

Great content. Welcome to Hashnode! :)

1
·
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
·
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?

·