![pico8 mapdraw pico8 mapdraw](https://www.lexaloffle.com/bbs/files/1/voxatron_spiral_2.gif)
Lua CPU stats were only updated every 2048 cycles as of 0.1.12c, but in 0.2.0 they started being updated at a precision closer to once per conceptual operation.įunctions that add negative Lua cycles
![pico8 mapdraw pico8 mapdraw](https://i.ytimg.com/vi/QnDRmPx8yLY/hqdefault.jpg)
#PICO8 MAPDRAW PLUS#
exponentiation (^): 2 regular cycles plus a considerable system cycles cost, described in the system.multiplicative operators (*, /, %, \): 2 cycles.Multiple (x1,x2.,xn = y1,y2.,yk): (max(n,k) - 1) * 2 cycles, plus 2 cycles for each right side expression without a cycle cost.(yes, this means x=x+y is cheaper than x=y). Simple (x=y): 0 cycles if right side of expression already has a cycle cost.Upvalues (local variables in another function): 2 cycles.Local variables in same function: 0 cycles.Some standard Lua operation costs: (tested on 0.2.0h) If a global or non-local variable is read multiple times, it'd save cycles to cache it in a local variable first (this helps a bit even if the variable's read twice). Access to global or non-local variables (locals from other functions) is slower than access to local variables - use local variables instead, if possible.
#PICO8 MAPDRAW CODE#
![pico8 mapdraw pico8 mapdraw](https://4.bp.blogspot.com/-dU8qoK9AclI/V7Y_YWGdBFI/AAAAAAAAAC0/Tv5BehUisPQSJ5IHkz6RI2WbS27iOC8VgCLcB/s1600/PICO-8_11.gif)
Some tips for when your code isn't running fast enough: (these will increase your code's size and reduce its clarity, however - it's a trade-off)