-
Notifications
You must be signed in to change notification settings - Fork 16
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 inprovements for chat drawer #63
Conversation
Thank you for this improvement! If you want to check the performance of the mobile version, I think the drawer animation can also be improved (see https://github.com/diaspora/diaspora/blob/develop/app/assets/stylesheets/mobile/header.css.scss#L172) even if I use a CSS translate here too, the animation is not really smooth. |
Attaching the mobile browser through a remote debugger would help diagnose the problem. I will test the mobile version today - if I will come up with good results, I will do a pull-request :) |
@dimaursu you can also open issues about it, I'd like to learn how to improve CSS performance :) |
@dimaursu thank you very much for your contribution. Could you do me a favor and remove the changes made in Cheers, Lukas |
@zauberstuhl done :) Btw, that should be written in the README, the stuff about |
Performance inprovements for chat drawer
With this PR the classes |
I switched the animation from a jQuery based one, to a pure CSS implementation.
The state of the drawer(open-closed) is kept in a checkbox.
The new animation uses
transform: translate3D()
- this moves the drawer in a separate render layer, and the performance improvements are at least 3x, in Firefox benchmarks. On my Thinkpad X201, in the jQuery implementation the FPS would drop to about 5, now it's at about 15 FPS, and the animation is much smoother (it's visible with the naked eye).Some visual tradeoffs were made - I got rid of the box-shadow, and the drawer doesn't push the content (which triggers layout recalculations and repaints).
For now I didn't use any vendor-specific prefixes, those will be added later, maybe through AutoPrefixer (https://github.com/postcss/autoprefixer)