New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance mangle
#5359
enhance mangle
#5359
Conversation
I spent a half hour studying this: Lines 659 to 673 in ef0fcfd
So if I'm not mistaken, within each block you're moving the variables that have the most references to the front of the mangle list, and if within the cutoff they are sorted by initial index in said list, and then the remaining variables after the cutoff are sorted by their initial indexes and then appended. The reason being that often repeated variables ought to receive the shortest mangled names. Did I get the gist of it? I wonder if proximity between instances of the same variable and contiguous runs of uses of a given variable without intervening differing variables should also be taken into account, as it impacts the effectiveness of the sliding LZW compression window. |
Basically yes − it's a fight between locality vs. total byte count, which is amplified by the recent advances in With one exception (pending further investigation), the uglified size monotonically decreases with
That's part of the consideration when brainstorming for this, with the view that restoring (declared) order being a good approximation, since we don't have direct access to information regarding "contiguous runs of uses" in Any ideas as to how to retrieve said metrics? We do perform a full tree traversal in |
OT: I'm encountering these "skipped" macOS jobs with increasing frequency, more than half a dozen per day for the past week or so 😕 |
I'll think about it and try to put some code together through trial and error. Even seemingly promising theories can fail miserably in practise. Inlining, as you pointed out, plays havoc with locality. Terser often has better gzipped sizes for large bundles despite having larger non-compressed minification.
macOS is becoming less of a server OS and more of a desktop OS from what I've observed. With every OS upgrade my machine gets slower and less reliable. Just last week it locked up hard and it took me a half hour to figure out how to reboot my machine by holding down the power button for 5 seconds. Perhaps it's common knowledge, but I never had to do that before. |
By the way, does this PR generally improve gzip results on the benchmark bundles? |
Thanks in advance 😉
Yup, that's how I perform verifications 👻
Thanks to ACPI standards − no thanks to Apple 👿 |
My mangle idea was computationally impractical. When you have a sliding window of symbol characters it is not uniform throughout the input so just the act of choosing the next available symbol based on the local window character frequencies of each occurance of the symbol becomes a major ordeal compared to the simple base54 system. Never mind the chaotic feedback between the previously chosen symbol names which would impact the sliding window. Back to the drawing board. |
That's pretty cool. I see you chose 36 where uglify+gzip begins to level out. Any particular reason why you didn't go with 53 which is a minimum for both uglify and uglify+gzip? Is it slower? With any heuristic dependent on statistics you have to be aware of overfitting to specific test case(s). How did it fare against the larger input test cases in https://github.com/privatenumber/minification-benchmarks ? |
Oh that is just an example − specifically I've went through all ten inputs to Here's the one for As you can see, the previous value of |
Nice. As I recall, |
No description provided.