Performance of this siteMeasured live on Oct 20, 2026
Measure before you touch it.
Three performance problems in this portfolio itself, each with a cause found by measuring, and two ideas that looked good until measurement rejected them.
- Chrome DevTools Protocol
- traces
- Long Animation Frames
- Three.js
This site's 3D intro dragged: scrolling at 21 fps, a 1.25 s frame on the transition and the page jumping (CLS 0.60).
I measured each one with traces and Long Animation Frames, found the cause by measurement and left a test that fails if the defect returns.
Scrolling near 60 fps, a 183 ms worst frame and CLS 0 on laptop, large monitor and phone.
Source ¹
Aug 30, 2026, Chrome with GPU, the page's own meter; live, 17.4 ms (~57 fps).
Source ²
Sep 14 and Sep 20, 2026, 1920×1080, first visit, real Chrome without throttling; four cold visits in a row live: 183 · 200 · 284 · 283 ms.
Source ³
Oct 9, 2026 (before); Oct 20, 2026 live, script testes/_dez-segundos.mjs at 1366, 1920 and 390.
Three decisions
1. Replace five background layers with screen-sized boxes
BecauseThe trace showed 0.5 s of JavaScript against ~9 s of compositing: a long frame without a long JS task is compositing.
CostProving pixel by pixel that the drawing did not change: mean difference of 0.37 out of 255.
2. Save once the computation that was constant
BecauseThe environment map cost ~700 ms and gave the same result on every machine.
CostOne more 166 KB file, preloaded and opened in a worker (681 ms → 1 ms).
3. Move the canvas with transform, not layout
BecauseEvery layout repositioning counted as the page jumping.
CostEvery position calculation moved to transform, anchored to the corner.
- Role
- Everything: it is my site
- When
- August to October 2026
- Tools
- Chrome DevTools Protocol · traces · Long Animation Frames · tests that fail on regression
- Result
- 21 → 60 fps¹ · worst frame 1,251 → 183 ms² · CLS 0.60 → 0³
1. Scrolling at 21 fps was not the 3D
The turn from the opening to the second room dragged: 48.5 ms per frame. A study pointed at five causes; measurement refuted four (re-renders, layout, garbage collection, pixel density). The trace settled it: 0.5 s of JavaScript against ~9 s of raster and compositing in the same 13.8 s window. A long frame with no long JS task is compositing.
The cause: five background layers, each 1.85 screens in area with transparency, added up to ~9 screens of blending per frame, the ceiling of an integrated GPU. They became screen-sized boxes with the same geometry rewritten. To prove the picture did not change, I compared the background pixel by pixel at seven scroll positions: mean difference 0.37 out of 255.
A test now fails above 30 ms per frame, and it was seen failing with the defect put back.
2. The pass to the second room: from 1,251 ms to 183 ms
Worst frame on a first visit, at 1920×1080, with the visitor scrolling from the first second. Three causes:
- A "sliced" queue that did not slice. Steps were chained with
setTimeout(0), and the browser ran them back to back without painting in between: a new task is not a new frame. What yields to paint isrequestAnimationFrame. - A computation that was a constant. The 3D environment map cost ~700 ms and gave the same result on every machine. It became a 166 KB file, recorded once, preloaded and unpacked in a worker: 681 ms → 1 ms.
- Slice by time, not by count. Each turn of the queue pays for pieces until it spends 30 ms, because a piece costs anywhere from 2 to 447 ms.
3. The page that jumped: CLS 0.60 → 0
The 3D canvas was repositioned through layout properties on every adjustment, and the browser counted each one
as the page jumping: CLS of 0.60 at 1366, 0.14 at 1920 and 0.10 on tablet. Now it moves with
transform, anchored to the corner. Measured live today: 0.000 on laptop, large monitor and phone.
What went wrong: two ideas the measurement rejected
- Idea 1create the 3D programs earlier: 961 / 817 / 1,039 ms against 864 / 936 / 865 ms, no change
- Idea 2only work while the page is still: someone who keeps scrolling never gives the break, and the worst frame hit 2,401 ms
What stayed: The method: every idea goes through measurement before it stays.
The method
- Measure on the device and screen size of whoever complained: at 1366 the pass was already smooth, it only froze at 1920.
- Look for the contradiction in the signal: a long frame with an idle main thread is not JavaScript.
- Prove the fix did not change what the visitor sees.
- Leave a test that turns red if the defect comes back.