OutoftheBOTS_ wrote: ↑Sat Aug 25, 2018 9:12 pm
...It seems heap access is super slow...
The principal problem is that heap allocations are not deterministic: while normally fast they can occasionally trigger a garbage collection which may take 5ms. In some applications this can be circumvented by periodically issuing
gc.collect(). This reduces GC time to <1ms. More importantly you can sometimes do GC at a time when it has no effect on application performance. Further, periodic GC can reduce heap fragmentation which can cause applications to fail.
The above times are times I have measured in applications on a Pyboard. Mileages will vary
