caliban icon indicating copy to clipboard operation
caliban copied to clipboard

World's smallest micro-optimization

Open kyri-petrou opened this issue 1 year ago • 1 comments

Full disclosure. This will probably have 0 meaningful impact to anyone's application, but I saw it the other day and couldn't help myself 🥲 I wouldn't be doing this is the previous code was intuitive or more readable, but I think they're both equally bad when it comes to readability.

Anyways, in APQs, instead of converting each byte into a string and extracting its 4-bit representation (hex), we just do the comparison on the fly avoiding materialising anything in memory.

kyri-petrou avatar Jun 28 '24 12:06 kyri-petrou

Hum... 🙄 I think the old one is definitely more readable 😅

ghostdogpr avatar Jul 01 '24 07:07 ghostdogpr