aboutsummaryrefslogtreecommitdiff
path: root/lib/libcxx/include/__algorithm/transform.h
diff options
context:
space:
mode:
authorNico Elbers <nico.b.elbers@gmail.com>2025-11-03 12:10:59 +0100
committerNico Elbers <nico.b.elbers@gmail.com>2025-11-27 15:46:35 +0100
commit03a3269d48db03f1998166f63ad5195cbba2dd88 (patch)
treeb91a0cc027cec970931fba74b41f89d3c63864df /lib/libcxx/include/__algorithm/transform.h
parentceba9572ef5fc3a4c7e2e3f315d05842d2422d0c (diff)
downloadzig-03a3269d48db03f1998166f63ad5195cbba2dd88.tar.gz
zig-03a3269d48db03f1998166f63ad5195cbba2dd88.zip
Optimize Reader.takeLeb128
Rewrite `Reader.takeLeb128` to not use `takeMultipleOf7Leb128` and instead: * Use byte aligned integers * Turn the main reading loop into an inlined loop of static length * Special case small integers (<= 7 bits) Notably signed and unsigned 32 bit integers have 5x to 12x(!) performance improvement. Outside of that: For u8, u16 and u64 performance increases ~1.5x to ~6x For i8, i16 and i64 performance increases ~1.5x to ~3.5x For integers with bit multiples of 7 performance is roughly equal within the margin or error. Also expand on test coverage Microbenchmark: https://zigbin.io/242cb1
Diffstat (limited to 'lib/libcxx/include/__algorithm/transform.h')
0 files changed, 0 insertions, 0 deletions