Closed Seggan closed 8 months ago
Yep, Esolang Park is a pretty slow experience if you just want to run some code without any frills. The execution interval is currently limited to at or above 5ms because the React render takes quite a lot of time as compared to the execution time. This is also mentioned in the wiki in a bit more detail.
A possibly better solution than the one mentioned in the wiki is to rework how messages from the message queue are processed. If we perform batch processing of messages say every 50 ms (or atleast debounce the visualization rerender), it will allow us a very comfortable window to re-render almost anything we want. This is off the top of my head though - there may be some blockers here regarding how the editor highlights and code output are updated on message processing. But I think this should be feasible.
Let me see if I can take a look at this on the weekend.
Okay, this is trickier than I thought. Removing the sleep() call on the execution controller side will cause the while-loop to block processing of messages from the main thread - meaning pause and stop actions won't work. And keeping a sleep(0) adds too much event-loop overhead - it's not much faster than 5ms.
The execution interval input now allows 0ms as input. @Seggan How long does your program take to execute on this setting?
The execution interval input now allows 0ms as input. @Seggan How long does your program take to execute on this setting?
Around a second for 64 iterations now! (And ~3 seconds for 128 iterations) Thank you so much! It's so much less painful now!
Sometimes you just want your code to run as fast as possible. Even at 5 ms computing the Taylor series for atan to 64 terms (don't ask) takes around 2 minutes.