On Fri, Feb 7, 2014 at 2:52 PM, Nicholas Nethercote
<[email protected]> wrote:
>
> If you choose to atomize a char sequence, it incurs costs.
>
> 1. Time: you have to check if the char sequence has been previously
> atomized. In our implementation, this involves a hash table lookup,
> which includes a hash computation.
> [...]
> Hopefully these costs are smaller than the potential savings.
> [...]
> 2. Space: if the char sequence occurs N times, you avoid storing it N-1 times.

And these are the only two places where the length of the string is relevant.

Nick
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to