tldr; go to the DEMO

Whether you are using a full framework or vanilla JavaScript, the browser follows the same principles in how it operates. Understanding these principles can make the difference between a janky, frustrating experience and a smooth, enjoyable one.

Quick corrections and facts

JavaScript runs on a single thread, and it must yield control back to the browser, so that multiple tasks can run.

The browser rendering cycle for a single frame looks like this:

  1. style calculation
  2. reflow (also called layout) – computes positions and sizes
  3. repaint (also called paint) – paints pixels into layers
  4. composite – composes layers together, often on the GPU Frame budget math: There are 1000 milliseconds in one second. Dividing by 60 fr…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help