theCrag / website

theCrag.com: Add your voice and help guide the development of the world's largest collaborative rock climbing & bouldering platform
https://www.thecrag.com/
110 stars 8 forks source link

Split Topo render into separate stages for speed boost #861

Closed brendanheywood closed 10 years ago

brendanheywood commented 11 years ago

Split the topo render code into distint phases. At the moment it does lots of calculating, rending and re-rendering in serial as each point is added. By breaking it down into distinct stages it will save a lot of cycles re-drawing things, updating the SVG dom is the main render bottleneck.

I can also put all the bezier calculating stuff into a webworker which will also stop the UI from blocking while this is all happening.

1) Load data & build object graph 2) Calc bezier shapes 3) Render

brendanheywood commented 11 years ago

Also setup all events as a separate stage:

4) detect mouse / touch and only setup the evens needed

brendanheywood commented 10 years ago

Done in new topo tool. The idea of doing more calc server side is not needed anymore as the performance is rocking. If we want to do server side calc we can do it with js on the server instead of a perl port (like pdf's).