Version: 0.5.30.21.00.22.00.22.10.22.30.23.0-alpha.00.23.0-alpha.10.23.0-alpha.20.23.0-alpha.30.23.0-alpha.40.23.0-alpha.50.23.0-alpha.60.23.0-alpha.70.23.0-alpha.80.23.0-alpha.90.23.0-alpha.100.23.0-alpha.110.23.0-alpha.140.23.0-alpha.150.23.0-alpha.160.23.0-alpha.170.23.0-alpha.180.24.0-alpha.10.24.0-alpha.20.24.0-beta.10.24.0-beta.20.24.0-beta.30.24.0-beta.40.24.0-beta.50.24.0-beta.60.24.00.25.00.25.10.25.20.25.30.25.40.25.50.25.60.25.70.25.80.26.00.26.10.26.20.27.00.28.00.28.10.28.20.28.30.29.00.29.10.29.20.29.30.29.40.29.50.29.60.29.70.29.80.29.90.29.100.30.00.30.10.30.20.30.30.30.40.30.50.31.00.32.00.32.10.32.20.32.30.32.40.32.50.32.60.32.70.32.80.32.90.33.00.33.10.33.20.33.30.33.40.33.50.33.60.33.70.34.00.34.10.34.20.34.30.34.40.34.50.34.60.34.70.34.80.35.00.35.10.35.20.35.30.35.40.35.50.35.60.35.70.35.80.35.90.35.100.35.110.36.00.36.10.36.20.36.30.36.40.36.50.36.60.37.00.37.10.38.00.38.10.38.2-alpha.10.38.2-alpha.20.38.20.38.30.38.4-alpha.10.38.40.38.5-alpha.10.38.5-alpha.1.60.38.5-alpha.1.6.10.38.5-alpha.20.38.5-alpha.30.38.5-alpha.40.38.5-alpha.50.38.5-alpha.60.39.00.39.10.39.20.39.30.40.00.40.10.40.20.41.00.41.10.41.30.41.40.42.00.42.10.42.20.43.00.44.00.45.00.45.10.45.20.45.30.46.00.47.00.47.10.47.30.47.40.47.50.47.60.47.70.47.80.47.90.48.00.49.00.50.00.50.10.50.20.50.30.50.40.51.00.51.10.52.00.52.10.53.00.54.00.54.10.54.20.55.00.55.10.55.20.55.30.56.00.56.10.56.20.57.00.57.10.57.20.58.00.59.00.59.10.59.20.60.00.61.00.61.10.61.20.62.00.62.10.62.20.62.30.62.40.62.50.63.00.63.10.63.20.63.30.63.40.63.50.64.00.65.00.65.10.65.20.65.30.65.40.66.00.66.10.67.00.68.00.68.10.69.00.69.10.69.20.69.30.70.00.71.00.71.10.71.20.72.00.73.00.73.10.73.20.74.00.74.10.74.20.74.30.75.00.76.00.77.00.77.10.77.20.77.30.77.40.77.50.77.60.78.00.78.10.78.20.79.00.79.10.79.20.79.30.79.40.80.00.80.10.80.20.80.30.81.00.82.00.83.00.83.10.84.00.84.10.84.20.84.30.85.20.85.30.85.40.85.50.85.60.85.70.85.80.85.90.85.100.85.110.85.120.85.130.86.00.87.00.87.10.88.00.88.10.89.00.90.00.90.10.91.00.91.10.91.20.92.00.92.10.92.20.92.30.93.00.93.1
/**
Strongly hint runtimes to intern the provided string.
When do I need to use this function?
For the most part, never. Pre-mature optimization is bad, and often the
runtime does exactly what you need it to, and more often the trade-off isn't
worth it.
Why?
Runtimes store strings in at least 2 different representations:
Ropes and Symbols (interned strings). The Rope provides a memory efficient
data-structure for strings created from concatenation or some other string
manipulation like splitting.
Unfortunately checking equality of different ropes can be quite costly as
runtimes must resort to clever string comparison algorithms. These
algorithms typically cost in proportion to the length of the string.
Luckily, this is where the Symbols (interned strings) shine. As Symbols are
unique by their string content, equality checks can be done by pointer
comparison.
How do I know if my string is a rope or symbol?
Typically (warning general sweeping statement, but truthy in runtimes at
present) static strings created as part of the JS source are interned.
Strings often used for comparisons can be interned at runtime if some
criteria are met. One of these criteria can be the size of the entire rope.
For example, in chrome 38 a rope longer then 12 characters will not
intern, nor will segments of that rope.
Some numbers: http://jsperf.com/eval-vs-keys/8
Known Trick™
@private
@return {String} interned version of the provided string
*/
export default function intern(str: string): string;
//# sourceMappingURL=intern.d.ts.map