News for hackers. Stuff that matters.
Re:What Spectre and Meltdown Mean for WebKit by flohofwoe on Tuesday January 09, 2018 @02:53AM (#16104351)
1ms is absolutely overkill IMHO and will require rewriting a lot of code which measures frametime this way. This is not an issue for the precision reductions in the other browsers (Chrome's 100us is just about what's still tolerable, Firefox's 20us is fine). It's probably better to round the measured frametime to the next 'vsync frametime' like 16.667ms or 33.333ms anyway, but I expect a lot of WebGL demos and games to break :/
Re:What Spectre and Meltdown Mean for WebKit by iainmerrick on Tuesday January 09, 2018 @08:55AM (#16106122)
What's an example scenario where you need an ultra-high-resolution timer?

For WebGL, don't you just rely on requestAnimationFrame to call you at the right times, and draw your frame as quickly as possible? What's the benefit of being able to measure the frame time to the nearest microsecond, rather than the nearest millisecond?

Re:What Spectre and Meltdown Mean for WebKit by andrewmcwatters on Tuesday January 09, 2018 @07:13PM (#16111439)
Timing behavior in literally any game.
Re:What Spectre and Meltdown Mean for WebKit by iainmerrick on Wednesday January 10, 2018 @05:01AM (#16113757)
Does the timer need to be much higher resolution than the frame rate? If so, why?

Maybe you want to measure the frame rate precisely? That is certainly something you can do, but not usually something you need to do.

Re:What Spectre and Meltdown Mean for WebKit by om2 on Tuesday January 09, 2018 @04:57AM (#16104874)
We are looking at ways to make it more precise but with random jitter. 1ms is a stopgap.
Re:What Spectre and Meltdown Mean for WebKit by joosters on Tuesday January 09, 2018 @09:58AM (#16106565)
Can't the timing (in)accuracies be worked around by javascript? There must be countless numbers of timer-triggered events in JS, not just the high-res timers but simple second-by-second counters, frame sync events, or even external I/O. Every possible time-based event needs to be made imprecise, otherwise programmers can derive a higher precision timer from them.

e.g. if you have a tight loop that just increments a counter, couldn't you just run that for a second (interrupted by a lower frequency timer source), then find out how many counts/second the JIT can perform, presumably millions or billions. To time operation 'X', you then just perform X and run the tight loop again, and compare how many fewer tight loops you completed.