top | item 43245113

(no title)

valand | 1 year ago

Fun fact, V8 interns strings! But it doesn't seem to intern big ones.

discuss

order

nostrademons|1 year ago

Many VMs do. The JVM was one of the first to do this extensively - all strings are in a "constant pool" as part of the .class format, and then they're referenced by index in instructions. Python does it for strings that appear in source code, and you can force it for runtime data with sys.intern().