cdglabs / apparatus

A hybrid graphics editor and programming environment for creating interactive diagrams.

Home Page:http://aprt.us/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recursive drawings: Deep shape hover causes tab crashes

joshuahhh opened this issue · comments

Drawing is at https://gist.github.com/joshuahhh/803198a67c7332a17548. The chain of circles starts at the bottom and goes up. If you hover over an early circle, it turns red immediately. By the time you get 8 or 9 deep, hover-to-red latency is noticeable. By the end of the chain, hovering freezes and then crashes the tab.

(I'm not sure how well recursive drawing is supposed to be supported, so this may be a low priority.)

Yes, recursion has performance problems. I am not sure yet the core issue, but from my limited profiling and playing around, my first suspect is that following Links (which is how references work between nodes) gets slow with recursive structures, because the algorithm has to go all the way up the tree (and back down) in order to resolve a link.

Not sure though. Recursion was only recently put in and hasn't been tested too much. I think there will likely need to be some rethinking of Node and Link in order to make it performant and also in order to have sane persistent file sizes. You'll notice when you save recursive diagrams they are really big. This is because a structure is created for every shape that is rendered.

So yes, recursion needs work. Happy to discuss more if you have questions.