ijson icon indicating copy to clipboard operation
ijson copied to clipboard

Avoid intern short Strings

Open gkorland opened this issue 1 year ago • 1 comments

In case the string is less than 8 bytes, will storing the string and not a pointer will save some space?

Also in some of the cases interning the IString doesn't worth it since the value is unique and in fact we just add overhead.

gkorland avatar Mar 23 '23 14:03 gkorland

It's possible this could work on 64-bit platforms. But it would add a fair amount of complexity. Could maybe limit it to 7 characters which would allow the low bits to still contain the tag value for string, and the length could also be stuffed into that byte in the non-tag space.

Diggsey avatar Mar 24 '23 00:03 Diggsey