3 ms·
As a curiosity, global string cache is an old feature of R -- however strings are matched upon creation rather than detected by the GC.
by mbq 12y ago
As a curiosity, global string cache is an old feature of R -- however strings are matched upon creation rather than detected by the GC.
- chrisseaton 12y agoThe problem with that is every time you create a string you have to do the work to look it up in the cache. The benefit of the JVM's approach here is that it only bothers to deduplicate it if it is long-lived enough to be evacuated.
- mbq 12y agoSure; in R strings are copied way more frequently than created, so it pays off.
- ris 12y agoIt's also possible to do this in python with the intern () builtin.