3 ms·
> Looks like Debian is mostly on top of it I wonder... I'm assuming their concern surrounds stuff that is installed on-disk with the package manager. Is there
by zamalek 11y ago
> Looks like Debian is mostly on top of it
I wonder... I'm assuming their concern surrounds stuff that is installed on-disk with the package manager. Is there any benefit at all to JS minification when the file:// protocol is in use? Marginal (if at all) improvements to parse time? Anything else? Or is "everyone doing it?"
- teamhappy 11y agoUglifyJS also evaluates constant expressions and that kind of thing. So you get a couple of basic optimizations.
- jon-wood 11y agoApt can be used to install web applications to be hosted from a Debian based server, so just because you're installing a package on a machine doesn't mean the files it installs won't be accessed remotely.
- nteon 11y agoV8 uses a function's length in characters, _including comments_, to make optimization decisions. By removing comments and shortening var identifiers internal to a function, I can imagine a number of functions dropping under that 600-char threshold. Would be great to measure.
- 0942v8653 11y agoSomeone in the last thread mentioned that you can actually configure this limit. So it may be slightly more accurate in the ratio when minified but probably not worth it.
- the8472 11y agothat seems like a terrible way to measure things. why not go by the number of some form of nodes after parsing? Parsing has to happen before optimization anyway.
- gmac 11y agoAgreed, this is awful. Presumably it means that adding comments can slow your code down, which I would otherwise have thought a completely laughable suggestion.
- laumars 11y agoThe problem with JIT compiled languages is compilation time is as critical as the performance of the compiled code. Using string length happens to be quicker than producing ASTs. So while it is a dirty hack, it generally offers greater performance more often than not.
- striking 11y agoNope. Parsing happens inline with execution, unless the function has less than 600 characters, where it'll be compiled down instantly. If it has any hotspots after that, they'll be JIT optimized. It is a terrible way, but you can't complain that it's a lot faster than rewriting V8 to count nodes.
- lukeschlather 11y agoA proper linter like JSLint or JSHint is preferable, but minifying is a basic syntax check. Obviously not the best way to do it, but it's a benefit.