rtic-scope / itm-decode

A library for decoding ARM Cortex-M ITM and DWT packets
https://docs.rs/itm-decode/*/itm_decode/index.html
Apache License 2.0
1 stars 2 forks source link

Decoder::pull is slow (probably) #3

Closed tmplt closed 3 years ago

tmplt commented 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

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).

Is there a better way?