All stories
Mobil

Bypassing iOS Safari's 60 FPS limit with scrolling

Bypassing iOS Safari's 60 FPS limit with scrolling

Developers building web apps for iOS Safari have long faced a frustrating limitation: apps get stuck at 60 FPS even on 120 Hz screens. According to the report, this cap cannot be lifted unless a hidden option in Safari's developer settings is changed, and touch events are processed at the same rate. This makes even the best mobile sites feel sluggish to users.

A developer tried to overcome this by leveraging the native advantages of a scroll area. The article explains that scrolling runs on the browser's own thread, moving smoothly without a JavaScript round-trip. The idea is to read the scroll position frequently enough and apply it to animations. However, regular scroll events only update 5 to 26 times per second, which is not enough.

The developer experimented with several methods to read scrollTop and scrollLeft synchronously. A recursive MessageChannel allowed 50,000 reads per second but yielded only 80 distinct values, pinning a CPU core in the process. An Atomics-based approach produced similar results but required security headers that broke cross-origin assets, so it was abandoned.

The method that finally worked was throttling a MessageChannel to the screen's refresh rate and synchronizing it with requestAnimationFrame. According to the report, this approach delivers 80 position reads per second, reaching two-thirds of the 120 Hz goal. The developer also notes that Safari sends scroll positions one at a time and waits for an acknowledgement, causing dropped positions.