4 ms·
Although it is hard to believe that JS code would be exactly the best compression for those machine instructions.
by diogofranco 10y ago
Although it is hard to believe that JS code would be exactly the best compression for those machine instructions.
- dualogy 10y agoHow about minified JS? What would be the best? Consider the massive amount of machine (or even IR) code that each identifier, built-in function, loop, switch and all other "syntax sugar" aka high-level-language-construct represents..
- marcosdumay 10y ago> What would be the best? Most likely, compressed opcode.
- dualogy 10y agoCould well be, depending on the app, dunno.. it's still the case that on the whole practically almost each lexeme in a high-level language expands into a giant ball of opcodes.. ;)
- dualogy 10y agoI mean you can compress those identifiers further into "op-codes-of-sorts" by renaming each to a 1-char but then that's what any minifier does
- flamedoge 10y agowhy stop there? just compress the entire dang thing and add decompressor in the execution.
- dualogy 10y ago"We're" (many) already doing that too via gzipped responses (faster to decompress than to compress == neat for web uses). That's my point, a higher language is already "compressing" machine representation (all abstractions kinda do), minification turns its lengthy identifiers into minimal "codes", then the gzip.
- flamedoge 10y agohm.. I assume gzip is doing a lot of entropy reduction already.. curious if minification has reduced or nil effect after gzip.