Open
Description
Currently the animation of the turtle sprite is a bottleneck for performance: you can't go faster than a few hundred moves per second. That is because each time the turtle is moved and a new line segment is drawn, its current position is recomputed in a pretty slow way. (The 2d transforms are zeroed, then the untransformed position is read, then the 2d transforms are reapplied, and the math is done in parallel by hand to see exactly where the transform-origin of the turtle is on the screen.)
We should investigate ways to speed it up, e.g.,:
- Assume that the untransformed position doesn't change under certain conditions.
- And in those cases assume that we can just cache and read position data on the side instead of deriving it from the dom.