The command stack should be optimized #50
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: twc/ludus#50
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If a turtle is "walking" in a straight line, say, 4 pixels per tick for 100 pixels, we would end up telling p5 to draw 25 4px lines instead of one single 100px line. This is inefficient.
It's reasonably easy to do the math here, so do it. (In
pkg/ludus.js
.)I believe this is actually what's at issue behind the performance issues with this sketch
In place of paths being more efficient, we've decided that it's easier/better to make commands more efficient: squash the commands when we ask for them, instead of doing it when we calculate the p5 path.
In addition, the idea is that we need to cache the already-squashed commands, so that we're not crawling the whole stack each time. Also: we can implement
clear
this way. This will be a more thoroughgoing refactor than I had hoped, but should make this much more performant.Paths should be (more) efficientto The command stack should be optimized