TheNotary / trtl

Tk-powered Ruby turtle graphics
MIT License
0 stars 0 forks source link

Drawing the tree example takes forever #2

Open TheNotary opened 9 years ago

TheNotary commented 9 years ago

Rendering examples/example4.rb takes over a minute.

To render the tree:

Given the fact that after the tree is 'finished' and the browser page is reloaded, the tree renders within 2 seconds, one can presume that the slowness of the tree has something to do with the websockets.

To increase the performance of drawing the tree, caching should be implemented on magic_mirror so that commands are sent 5 at a time instead of one at a time. If this produces a dramatic performance increase on drawing the tree, then an elegant form of caching should be implemneted so the caching algorithm is used only when the websocket server is 'bogged down' with many commands at a time.

TheNotary commented 9 years ago

The tree now takes 3 seconds to draw on a pretty good computer. I removed the meta-programming from the Render.cLine code in an attempt to improve speeds, but only managed to shave ~.4 seconds... and performance varies by about .4 seconds...

Any further performance aspirations should mean I setup a proper performance test system with multiple, averaged runs to check for performance changes.