3 ms·
Fun fact, V8 interns strings! But it doesn't seem to intern big ones.
by valand 2y ago
Fun fact, V8 interns strings! But it doesn't seem to intern big ones.
- nostrademons 2y agoMany 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().