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 issues with SVG-rendering #2240

Closed
fab1an opened this issue Nov 26, 2013 · 4 comments
Closed

Performance issues with SVG-rendering #2240

fab1an opened this issue Nov 26, 2013 · 4 comments
Assignees
Milestone

Comments

@fab1an
Copy link
Contributor

fab1an commented Nov 26, 2013

Here is a long discussion about SVG-rendering, which tends to be slow in leaflet, compared to other libraries: https://groups.google.com/forum/#!topic/leaflet-js/_WJquNpdmH0

Norbert Renner did some improvements, some of which change leaflet's functionality, but is there anything endusers can do to improve performance?

non-optimized: https://gist.github.com/nrenner/7535077
optimized: https://gist.github.com/nrenner/5635334

@mourner
Copy link
Member

mourner commented Nov 26, 2013

Thanks for the report, I've joined the discussion there.

Regarding easy workarounds, one thing to try is switching to Canvas for rendering http://leafletjs.com/reference.html#global. There can be a problem with hovering performance, but rendering lots of features should be much faster.

@mourner mourner mentioned this issue Nov 26, 2013
5 tasks
@fab1an
Copy link
Contributor Author

fab1an commented Nov 28, 2013

I have tried L_PREFER_CANVAS = true; with 0.7 now, strangely enough it makes my map unusable because there are constantly "moveend" events fired on initialization.

Reproducible in Mac/Firefox and Chrome

@mourner
Copy link
Member

mourner commented Dec 18, 2013

This should be improved significantly as of #2290 and some other recent perf improvements like better FeatureGroup events propagation (both SVG & Canvas). @fab1an try the new Canvas code (see changelog and debug/vector/vector2.html for example)

The only optimization left to do is event delegation for SVG, but lets keep this in a separate issue #2315

@mourner mourner closed this as completed Dec 18, 2013
@ghost ghost assigned mourner Dec 18, 2013
@mourner
Copy link
Member

mourner commented Dec 19, 2013

OK, event delegation implemented, along with some other optimizations, so now SVG should perform much better (in my tests, 3 times faster init/adding of GeoJSON compared to 0.7.1).

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

No branches or pull requests

2 participants