vcs.slashdirt.org Git - sw/tic2json.git/log
Further reduce memory pressure by using const char for labels
This essentially halves the number of allocations by only using them for
dynamic data (namely horodate and data).
Valgrind output on 100KB test:
- Before:
see previous commit
- After:
thread 1 finished and used 21967 bytes out of
8388608 on its stack. Margin:
8366641 bytes.
total heap usage: 4,961 allocs, 4,961 frees, 83,025 bytes allocated
parser: don't malloc()
At the cost of a slight stack usage increase, this drastically reduces
overall memory usage and improves performance since we don't incur the
malloc() penalty.
Sample figures from a single run over a 100KB test capture:
- Before:
thread 1 finished and used 17151 bytes out of
8388608 on its stack. Margin:
8371457 bytes.
total heap usage: 13,996 allocs, 13,996 frees, 255,865 bytes allocated
- After:
thread 1 finished and used 21967 bytes out of
8388608 on its stack. Margin:
8366641 bytes.
total heap usage: 9,516 allocs, 9,516 frees, 112,505 bytes allocated
parser: output frames as individual root elements
parser: simplify error recovery
parser: implement masking zero-values
parser: parse hex values (STGE)
parser: process int values as ints
parser: prepare to process int values
don't copy label
add stty.settings
fix error handling/recovery
Improve error reporting too.
Error messages are sent to stderr, so stdout still carries a valid JSON
stream.
initial commit fully working on sample data
tic2json TIC parser/converter
RSS
Atom