in reply to Sweating the small stuff: a lesson in optimisation

Porculus,
You may find Efficient 7bit compression amusing.

Cheers - L~R

  • Comment on Re: Sweating the small stuff: a lesson in optimisation

Replies are listed 'Best First'.
Re^2: Sweating the small stuff: a lesson in optimisation
by Porculus (Hermit) on Mar 16, 2009 at 22:33 UTC

    Indeed I do! Thanks for the link. It's fun to see how differently the implementations evolve when the goal is to optimise for footprint over speed. I guess I've supplied the missing runtime-optimised versions, just a few years late. :)

    (I also observe in passing that the implementations in that thread are all buggy in the general case. They don't take into account that "foo bar" and "foo bar\x00" will pack to identical strings. Not a problem if you know there are no nulls in the input, but that's why the length byte in my data gives the number of packed characters rather than simply the length of the field.)