mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-04 01:29:18 +01:00
This patch dramatically reduce pressure on heap memory: - use a StringTokenizer instead of the very slow String.split(...) method to decode newlines. This avoid allocation/deallocation of big strings array and use of regexp. - pre allocate as many object as possible to avoid new allocation while streaming data. - the "timestamp" string is calculated only once per iteration. - use StringBuilder instead of inline temporary strings (that are, again, allocated and deallocated on each iteration)