Skip to content

[AnimationSmoothness] Drive-by feedback about the animation smoothness proposal #1088

@noamr

Description

@noamr

Animation smoothness is a tough one, because it combines the need to measure it statistically over time, react to changes, and also not create too much overhead, either by over-measuring or over-reporting to the timeline.

Following the explainer and the several good alternatives presented there, I would suggest to go with something along the line of a bespoke observer (not a PerformanceObserver that works on the performance timeline) that can be started, stopped, queried for statistical information, and fire events when certain thresholds have been passed.

Something like:

const observer = new FrameRateObserver();
observer.granularity = 10;
observer.start();
observer.stop();
observer.stats(options);
observer.addEventListener("change", event => { ... })

This can be built as a polyfill on top of requestAnimationFrame, but having it in the platform can have a much lower overhead which in this case is important enough.

Hope you find this feedback helpful and please keep at it, it's a great problem to solve!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions