-
Notifications
You must be signed in to change notification settings - Fork 62
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
Poor rendering performance with a lot of grid lines #216
Comments
I spoke to @fryguybob about this on IRC:
|
Why 4 million? I would expect on the order of 2000 + 2000 = 4000 lines to make a 2000x2000 grid. |
What if you restructured so that the grid is a [-1000, 1000] X [-1000, 1000] array or vector of |
@byorgey: You are right, that was some sloppy maths! So it struggles with only 4000 lines then, which is even worse :) @jeffreyrosenbluth There are various ways that I can fix this, but I see the purpose of |
@ocharles What you get now is declarative, it is only the performance of the implementation that is leaking out. This isn't nice nonetheless. |
@jeffreyrosenbluth I think this is how you get the 4million items drawn performance. Drawing cells takes squared overhead, while lines is linear in the sum of the sides. Sure, you are clipping down to the viewport, but you pay for squared performance inside the viewport. |
Yes, i agree. It would be nice if we had some sort of lazy clipping function handled before the diagrams is passed to the backend. |
@fryguybob, that's sort of my point - I can't be declarative and ship a workable product. Right now I have to compromise on usability, or muddle the declarative structuring of code to something that has more context, purely for performance reasons. |
hmmm, It might be possible to add a cairo specific function say http://cairographics.org/FAQ/#clipping_performance (the section "Clipping should only make things faster, right?") |
If you think of a |
Also relevant with efficient implementations: https://trello.com/c/rKCAA3OZ |
FWIW Cairo seems to struggle with grid lines as well, so even if diagrams John
|
I am trying to make a cartography application, where the user starts with a "blank canvas" - a grid. The grid extends [-1000, 1000] in both the X and Y-axis, so there are 2000 * 2000 = 4mil grid lines to render:
As the user never sees the full grid, I am zooming/clipping to create a viewport:
This renders in about 0.15s (
diagrams-gtk
), which unfortunately not going to fly for real-time interaction.The text was updated successfully, but these errors were encountered: