Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance on Safari is very slow, barely works #90

Open
travisryan opened this issue May 13, 2023 · 6 comments
Open

Performance on Safari is very slow, barely works #90

travisryan opened this issue May 13, 2023 · 6 comments

Comments

@travisryan
Copy link

Mike, per our email discussion I'm creating this issue on the terrible performance of Safari (both Mac and iOS) of rendering the odometer in action.
From internet searches I believe changing the translate(X,Y) to a translate3d(X,Y,0) I think it would make safari render it with hardware acceleration and then it would look right.
Here are a couple links. It seems it might be back in Safari 14 or so that they made this change to help battery performance perhaps.
https://www.urbaninsight.com/article/improving-html5-app-performance-gpu-accelerated-css-transitions
https://stackoverflow.com/questions/9807620/ipad-safari-scrolling-causes-html-elements-to-disappear-and-reappear-with-a-dela

Thanks!
Travis

@coderitual
Copy link
Owner

thanks for reporting @travisryan !

@coderitual
Copy link
Owner

coderitual commented May 17, 2023

Upon analyzing the issue, I've identified several factors that might contribute to the slow performance. However, the two most significant factors include:

  • Constant layout recalculation in each frame
  • Non-GPU accelerated painting

Although the first factor could pose a problem, it does not appear to be the primary bottleneck. After conducting some tests, I found that the blur filter significantly underperforms.

The default configuration applies a motion blur to SVG nodes, which seemingly does not benefit from GPU acceleration. This can be corroborated by observing the substantial amount of time spent on the painting process. Given that we haven't yet addressed the layout reflow issue, it's evident that enhancing the painting process will lead to a substantial improvement in performance.

CleanShot 2023-05-17 at 11 03 57
CleanShot 2023-05-17 at 11 03 17

@travisryan
Copy link
Author

Interesting....

@travisryan
Copy link
Author

@coderitual Any more progress on this? Anything I can concentrate on to help etc?

@travisryan
Copy link
Author

Any updates Mike? Would REALLY appreciate it! :)

@coderitual
Copy link
Owner

Hey @travisryan , it seems that it is not going to be trivial since those svg filters are not hardware accelerated. There are couple things we may try to replicate this effect using different approaches. Not sure if we are able to achieve exactly the same without going fully canvas or webgl (which has other drawbacks). We may also try using simpler css filter or some sort of caching (e.g.pregenerating digits with blur).

All those things need some ground work and I am afraid will be time consuming. My suggestion for now would be to add an option to disable motion blur filter so at least it can be used on safari and maybe older devices. Feel free to open a PR for adding this option, I will help you to go through it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants