Open stassats opened 8 years ago
Thanks for the suggestions, this does give a nice speedup!
I've pushed f7e54cb9a503fcce9a24e601dc3af0fd6bef3eb4 with a new version of hex-digit-val
based on your function and the commit message includes some details about the speedup obtained. I'll look at the writer next.
I agree that binary IO would be faster. It may be worth reconsidering my approach. One nice thing about plain text is that it's easy to read what's actually being sent when debugging our application. Also even if I read 32 (or 64 or however many) bits at a time, I'm not sure how to avoid constructing ephemeral bignums...
Using lookup tables for conversion is a bit faster:
is faster on both SBCL and CCL.
is a bit faster too.
But you really should use binary I/O to avoid converting to characters and then doing the encoding conversion when printing.
You can also extend the tables to decode multiple at once.