javascript-obfuscator: Very slow code
Hello.
This code - https://jsfiddle.net/h3xzgre3/
Clear: 17.44 ms
Compact: 17.68 ms
Encoding OFF: 259.62 ms
Encoding BASE64: 333.79 ms
Encoding RC4: 356.6 ms
Reducing the speed of the code in 2000% (356ms/17ms)
Why is this happening?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (10 by maintainers)
No. I tried with simple object and map caches and got same or even longer results.
Also, half of additional time takes calls to StringArrayCallsWrapper function, so even without string to number conversion - time around 120-130ms in test.
So, i think - add additional post-obfuscation optimisation stage with various transformers (right now - single) - good choice.
This transformer will look AST-tree for for-in loops with 1000+ iterations, and move all StringArrayCallsWrapper calls outside of array.