-
Notifications
You must be signed in to change notification settings - Fork 380
Cache for box shadows #802
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
Conversation
mikke89
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I've finally gotten around to go through this PR now, and some testing with it.
First of all, thanks a lot for making the pull request. It's nice to see a focus on performance improvements too. I've made some comments throughout the PR, so please take a look at them.
I didn't measure it yet, but I am somewhat worried that all the extra data copies, hashing, and comparisons have some measurable performance impact. I have some suggestions in the comments that could alleviate some of that, but not all. Could you try to make some measurements, comparing it to master? Ideally, testing both cases: many unique box shadows, and another one for equivalent box shadows. An addition to the "Benchmarks" project would be very valuable here.
It would also be interesting to do the same for the geometry of all backgrounds/borders, as I suspect it is just as common to share styles in these cases. But that might as well be something to follow up with later.
|
Okay i tried all of the issues you mentioned, i'm still working on the cache part. However, I'm still trying to figure out how to deal with the shadow |
mikke89
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice progress.
I'm still trying to figure out how to deal with the shadow Geometry handle.
Yeah, I think it must be stored in the BoxShadowData, and then it needs to be retrieved from that data somehow. I understand it's a bit tricky with the other Geometry handles, I'll leave you to it :)
|
Finally got back to this, I think i implemented it correctly, I do need to fix the build issues, and merge the master branch back into this. |
|
Yeah nice, it's getting closer now, keep it up, and let me know when it's ready to take a new look at. |
|
I finally got around to trying this, I installed vckpg so i could finally try out the visual tests, and turns out I think i did some copy paste error somewhere beacuse the box shadows are incorrectly cached |
|
I got it to work, i compared it to the visual tests and they are identical now, the tough part is profiling the performance difference now, I wasn't able to get the tracy profiler to work. Could you aid here? |
|
Hey, thanks a lot! I made some changes, and added some benchmarks. Measurements look really nice. I have attached some measurements at the end here. Huge improvements to repeated box shadows in particular. Unique box shadows are about the same. We didn't expect any improvements for the latter, and it's not slower, so that is great success in my view. I changed the benchmarks a bit after these measurements, but they should be representative. Please feel free to look over my changes. If you're happy with them then I am ready to merge this, but let me know if you have some comments. master w/GL3 backend
PR w/GL3 backend
master w/no backend
PR w/no backend
|
|
Cool, I didn't expect that high of a performance liftup, so that's great to see, I like the changes you fixed, I had forgotten to change some of the documentation. |
5ed1b93 to
555e542
Compare
This particularly helps in situations with many elements of the same size with the same box shadow. Then the box shadow render resources will be reused between elements. This helps with the initial document render time, and can also significantly lower the total texture size permanently. Co-authored-by: Michael Ragazzon <[email protected]>
555e542 to
6b37d16
Compare
|
Great work! Thanks a lot, very happy to merge this one. Yeah, the exact performance numbers depend entirely on exactly how they are measured. But the main takeaway is that the box shadows are no longer regenerated when they can be reused. Which helps massively in some situations! Cheers! |
PR to solve issue #799