about summary refs log tree commit diff
path: root/compiler/rustc_serialize/tests/leb128.rs
AgeCommit message (Collapse)AuthorLines
2023-09-10Reimplement FileEncoder with a small-write optimizationBen Kimock-8/+6
2023-04-23Rewrite MemDecoder around pointers not a sliceBen Kimock-6/+7
2022-01-07Modify the buffer position directly when reading leb128 values.Nicholas Nethercote-4/+2
It's a small but clear performance win.
2021-03-24Revert "Revert stabilizing integer::BITS."Mara Bos-1/+0
2021-02-03Revert stabilizing integer::BITS.Mara Bos-0/+1
2021-01-31stabilize int_bits_constAshley Mannix-1/+0
2021-01-11rustc_serialize: fix incorrect signed LEB128 decodingTyson Nottingham-16/+44
The signed LEB128 decoding function used a hardcoded constant of 64 instead of the number of bits in the type of integer being decoded, which resulted in incorrect results for some inputs. Fix this, make the decoding more consistent with the unsigned version, and increase the LEB128 encoding and decoding test coverage.
2021-01-11Serialize incr comp structures to file via fixed-size bufferTyson Nottingham-15/+36
Reduce a large memory spike that happens during serialization by writing the incr comp structures to file by way of a fixed-size buffer, rather than an unbounded vector. Effort was made to keep the instruction count close to that of the previous implementation. However, buffered writing to a file inherently has more overhead than writing to a vector, because each write may result in a handleable error. To reduce this overhead, arrangements are made so that each LEB128-encoded integer can be written to the buffer with only one capacity and error check. Higher-level optimizations in which entire composite structures can be written with one capacity and error check are possible, but would require much more work. The performance is mostly on par with the previous implementation, with small to moderate instruction count regressions. The memory reduction is significant, however, so it seems like a worth-while trade-off.
2020-08-30mv compiler to compiler/mark-0/+45