summaryrefslogtreecommitdiffstatshomepage
path: root/unix-cpy
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-31 16:12:01 +0000
committerDamien George <damien.p.george@gmail.com>2014-07-31 16:12:01 +0000
commit4747becc6423e8161519ad6850e09137f14742a8 (patch)
tree347d25bcac7fdf71c2ac60c837b74b92ea0abd58 /unix-cpy
parent8cc2018d47bc15a1b10295965fc0ccd27c0dcbba (diff)
downloadmicropython-4747becc6423e8161519ad6850e09137f14742a8.tar.gz
micropython-4747becc6423e8161519ad6850e09137f14742a8.zip
py: Improve encoding scheme for line-number to bytecode map.
Reduces by about a factor of 10 on average the amount of RAM needed to store the line-number to bytecode map in the bytecode prelude. Using CPython3.4's stdlib for statistics: previously, an average of 13 bytes were used per (bytecode offset, line-number offset) pair, and now with this improvement, that's down to 1.3 bytes on average. Large RAM usage before was due to some very large steps in line numbers, both from the start of the first line in a function way down in the file, and also functions that have big comments and/or big strings in them (both cases were significant). Although the savings are large on average for the CPython stdlib, it won't have such a big effect for small scripts used in embedded programming. Addresses issue #648.
Diffstat (limited to 'unix-cpy')
0 files changed, 0 insertions, 0 deletions