ivan wrote: ↑Mon Dec 13, 2021 2:12 pm
Wish I could help with this issue, but I have no experience with MoonScript at all.
The reason for the excessive garbage is not the usual suspects; it's very carefully written to avoid that. It's the sheer number of traces generated by the JIT compiler. The alloted space fills up very quickly, older traces get evicted all the time, which results in endless churn.
I guess it's the way the code was written that makes the JIT go nuts, resulting in too many hot paths and with no trace abort ever happening.
Edit: if anyone has any insight into how to keep LuaJIT from specializing too much, I'm all ears. I never got any usable response to my questions on mailing lists and other channels.
I'm interested in understanding/improving the performance issue, but it seems the repository has been removed.
As a general solution to the JIT limitations I tend to use rudimentary dynamic compilation on top of it, i.e. to dynamically produce Lua code that can be more easily JIT compiled.
But I don't understand the Lua code well, nor the NES. I have an idea, but I don't know how much cycles can be computed before switching between the different PUs; to avoid jumping between them all the time at different computation steps.
Last edited by Imagic on Fri Aug 11, 2023 3:03 pm, edited 1 time in total.
I'm interested in understanding/improving the performance issue, but it seems the repository has been removed.
If I remember correctly, grump (who made this emulator) leaved love2d around year ago, removing all works that they done about love2d
You could try to search forks on github or try check internet archive, but yeah. That's about it.
I found a repository with the MoonScript sources, but it doesn't have the amount of documentation I was hoping for, and maybe not the latest improvements too. Apparently there were desires to remove projects and contributions from the author, thus it's not as interesting to look into this specific application.