Skip to content

Comment on Never create Ruby strings longer than 23 charactersparent

Comments

It's not arbitrary. It is the length available when taking the space the String objects must have in order to be able to handle strings allocated on the heap.

And I could write books about why Rails is such a pain to optimize but this is not it: This is an optimisation over the generic case of allocating the buffer elsewhere. An optimisation you also happens to find in C++ implementations for example.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.