News for hackers. Stuff that matters.
Re:Rope (data structure) by pcwalton on Saturday June 08, 2013 @01:01PM (#5845457)
In SpiderMonkey, JavaScript strings turn into ropes based on some heuristics (if you append to them a lot, I think). This helps a few benchmarks.

So while you might think a JavaScript string is just a pointer + length, the implementation is actually significantly more complex: the engine will pick different implementations depending on how it thinks you're using it.

Re:Rope (data structure) by mccr8 on Saturday June 08, 2013 @01:48PM (#5845594)
The whole hierarchy of SpiderMonkey strings is laid out in this comment in the code:

http://mxr.mozilla.org/mozilla-central/source/js/src/vm/Stri...