Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
1 / 5
0

What I learned measuring Pretext.js: things browser benchmarks don't tell you

DEV Community·Artem Zverev·26 days ago
#wrlZGi31
Reading 0:00
15s threshold

A while ago — though by current standards that already feels like ancient history — Twitter was loud with discussion of Pretext.js , a text-layout library whose headline claim is dramatic speedup over standard DOM measurement. Instead of letting the browser's layout engine compute text dimensions, it does the equivalent work in pure JavaScript on top of data prepared once via prepare() . The result, in theory, is no force-reflow on every measurement. Demos from different people looked impressive, so I got curious about how fast this actually is in practice. There was just one detail: I'm not particularly good at performance measurement. Outside of basic Core Web Vitals work — LCP, INP, the usual suspects — I had no real experience with this kind of micro-benchmarking. I started reading about how these measurements are actually done, and concluded that I should begin with the simplest possible test: comparing single-call costs across three strategies — DOM, Canvas, Pretext.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More