Load times of #GCodeSimulator & Printer
The current design point of GcodeSim is to load the gcode file into memory and analyse the memory structures. This makes the analysis much faster and the print does not suffer from additional IO latency (e.g. caused by SD storage).
This implementation requires a lot of memory when loading a large gcode file (~30MB for 300000 gcode lines) . Since Android starts with a small amount of memory (5-10MB heap) it needs to grow the heap while loading the file. This seems to be very slow because Android grows the heap in small chunks and starts several small garbage collection runs before.
As you can see on the picture below, loading small gcode files is quick but the first load of a larger gcode file must increase the heap memory and this can take long.
With GcodeSim V1.32 I have introduced a new option “Increase Memory heap when loading” which preallocates 30MB memory in one large step before loading. This speeds up the load times significantly.
Downside is that some devices might not have enough memory and crash the app, that the reason why it is turned off by default.