Hacker News new | past | comments | ask | show | jobs | submit login

Browsers don't particularly care about minified vs. unmagnified. Parsing time increases relative to the number of bytes being parsed. If a minified (among other things) strips dead code, that will give you a win.

[source: I wrote the JSC parsers]




Do minifiers typically strip dead code? Beyond removing whitespace and unnecessary semicolons, I know they rewrite some if statements into confusing?alternative:formats that save bytes but do the same thing, but really cutting parts out?

Obviously less non-whitespace data to parse will make the parsing faster, but I would be curious whether it bothers trying to detect dead code. It seems similar to a halting problem, knowing whether something can be reached, but I'm not well-versed enough in that theory to really say much more than this gut feeling.


minifies like typescript compilers, etc can remove dead code.

I recall some minifiers that definitely did - whether they're still in use I don't know (I haven't been working in engine dev for a few years).

For JSC's parsing the most expensive things are strict mode, and certain "errors" which basically trigger a rollback in the parser and then a reparse with more validation.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: