ulid-ruby icon indicating copy to clipboard operation
ulid-ruby copied to clipboard

Optimize `encode32`

Open casperisfine opened this issue 1 year ago • 0 comments

ENCODING is a String, and String#[] allocates another 1 char wise String.

So each encode32 call allocates almost 40 useless strings. By using an array instead, we avoid these allocations.

casperisfine avatar Apr 15 '24 08:04 casperisfine