Making CRC calculations in Mojo 18x faster than Python and 3x slower than Python
fnands.com
fnands.com
The original implementation [3] did the same thing but for CRC-64/XZ [4].
[1]: https://github.com/awesomized/crc64fast-nvme
[2]: https://reveng.sourceforge.io/crc-catalogue/all.htm#crc.cat....
[3]: https://github.com/tikv/crc64fast
[4]: https://reveng.sourceforge.io/crc-catalogue/all.htm#crc.cat....
[1] https://www.intel.com/content/www/us/en/docs/ipp/developer-g...
Finally, it's based on Intel's paper [2], so they also believe it's extremely fast. :)
[1]: https://reveng.sourceforge.io/crc-catalogue/all.htm
[2]: https://web.archive.org/web/20131224125630/https://www.intel...
Transpiling the python version in the blog to mojo gives me a 4x speedup.
Had to hand edit a couple of things:
- List to bytearray conversion is not working yet
- Can't iterate over SIMD. So a "for x in list" loop has to be rewritten as a range based loop.
With a bit more work, the manual edits won't be necessary.You mean 4x speedup over Python?
My guess is that it will start being used as a library language (i.e. have libraries written in Mojo being called from Python) before it really gets going as its own thing.
It has been about a year since I started playing around with Mojo and it's impressive how far it (and the community) has come!