Closed tmplt closed 3 years ago
Decoding a 1.5MB trace file with itm-decode takes a good few seconds. I think the root cause is our use of bitvec in Decoder::pull: https://github.com/tmplt/itm-decode/blob/eff09f1e902dceac745389c5a34c3c56f2dbe3a7/src/lib.rs#L381-L395
Decoder::pull
Because we want to pop 8 bits from the front we can rotate left 8 bits (super expensive) and pop the bits from the tail, or use zero-cost (?) BitSlices and then copy the tail of the bitstream into self.incoming (current approach).
BitSlice
self.incoming
Is there a better way?
Decoding a 1.5MB trace file with itm-decode takes a good few seconds. I think the root cause is our use of bitvec in
Decoder::pull
: https://github.com/tmplt/itm-decode/blob/eff09f1e902dceac745389c5a34c3c56f2dbe3a7/src/lib.rs#L381-L395Because we want to pop 8 bits from the front we can rotate left 8 bits (super expensive) and pop the bits from the tail, or use zero-cost (?)
BitSlice
s and then copy the tail of the bitstream intoself.incoming
(current approach).Is there a better way?