Closed CryZe closed 2 years ago
Hi! Thank you for your interest.
I've tweaked the code a lot to ensure no unnecessary bounds checks hinder compiler optimizations.
My goal was to outperform reference implementation in C.
At the time of the last commit rapid-qoi
was faster on encoding, slightly behind on decoding of some patterns and faster on others.
Things that I had to throw out include match
statements and most Index
trait usage, and most for
loops.
This fully safe version beats the C version in decoding by about 10%: https://gist.github.com/CryZe/282383fdddb1050c1fa6436b7a2c1c59
Yea, but how about up to 100% faster decoding?
Whoops, sorry there's actually bounds checks. However none of the unsafety here is even needed.