fnands / mimage

A library for parsing images in Mojo
Other
13 stars 1 forks source link

Pre-compute CRC32 table #3

Closed fnands closed 4 weeks ago

fnands commented 6 months ago

For the CRC32 calculation, the current implementation we have have calculates all values "on-the-fly".

However, the table of values can be pre-computed, even at compile-time. This would make this step significantly faster.

See: https://en.wikipedia.org/wiki/Computation_of_cyclic_redundancy_checks#Generating_the_tables

https://github.com/fnands/mimage/blob/4316bdfa9c4d6815c3733873b97a1faf42b7011a/mimage/utils/crc.mojo#L4

fnands commented 3 months ago

Blocked by: https://github.com/modularml/mojo/issues/3065

fnands commented 4 weeks ago

Fixed in https://github.com/fnands/mimage/pull/11