3 ms·
If you shrink a JS file by 50kb or more via minification (some JS libraries are a meg or more, so this is a realistic scenario - if not understating how much a
by kevingadd 3y ago
If you shrink a JS file by 50kb or more via minification (some JS libraries are a meg or more, so this is a realistic scenario - if not understating how much a minifier can do) that's a meaningful reduction in the # of bytes being processed. With how optimized and parallelized modern JS runtimes are it's probably only a few ms in total savings, but on older devices it could save more time. Historically it's been proven that small improvements to load time can have a measurable positive impact on a website.
Identifiers are often turned into atoms (which makes table lookup performance not really depend on how long they are) but for cases where identifiers are being looked up in dictionaries as raw strings, making them shorter could also improve runtime performance for your JS. I'm not sure how much this actually matters in practice though - I've seen dictionary key lookups show up in profiles here and there but it's usually not the main bottleneck.