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

Split up performance mode options #206

Closed
TheStanian opened this issue Dec 20, 2024 · 6 comments · Fixed by #210
Closed

Split up performance mode options #206

TheStanian opened this issue Dec 20, 2024 · 6 comments · Fixed by #210
Labels
improvement Feature improvement or enhancement

Comments

@TheStanian
Copy link

Right now there is a single "performanceMode" option. This both makes the points render as squares (easier on the fragment shader), and disables blending. Our application depends on having alpha blending, but point shapes aren't nearly as important. Some of our users only have a low-tier integrated GPU and we have ~11m points, so we could greatly benefit from just having the blending instead of both blend mode and shader change. Would it be possible to separate those two?

With kind regards & thanks in advance!

@flekschas flekschas added the improvement Feature improvement or enhancement label Dec 20, 2024
@flekschas
Copy link
Owner

This is certainly possible. I wonder what the performance gains would be from only switching from points to square shapes. Have you tested this by chance?

@TheStanian
Copy link
Author

I just tested this with Chrome's profiler, and it seems to more than halve my render times (~16.8ms => ~7.8ms). I can also barely tell that the shape changed at the size I'm looking at it. I have a hunch that the performance gains may have to do with not having to compete the square root to find the distance from the point center in the fragment shader, but that's speculation of course.

@flekschas
Copy link
Owner

Ah cool! Thanks for running the performance test. I'm not surprised it's faster as the fragment shader is a simpler and I suspect that every saved computation at some point matters performance wise.

If you have the chance, I'd be curious how much more performance the alpha blending saves.

Anyway, it shouldn't be hard to allow just using squares instead of rectangles. But I can't say exactly when I have time to add that feature given the holidays etc.

@TheStanian
Copy link
Author

I'll check the alpha blending difference tonight. No worries in terms of the timing. Happy holidays!

@TheStanian
Copy link
Author

I checked the difference between blending enabled and disabled while using the simplified shader and it seems to be about an 8% decrease in frame time when disabling blending. Granted, my measurements aren't all that because I'm getting ~6.4ms average now with blending and ~5.9ms without blending, so any (including previous) numbers should obviously be taken with a healthy dose of salt.

@flekschas
Copy link
Owner

PR for this is ready, if you have a chance, please give it a try. The changes are pretty straight forward. See #210

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

Successfully merging a pull request may close this issue.

2 participants