A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/fabiosantoscode/terser/issues/50 below:

Performance regression for collapse_vars=true with many var defs of complex objects · Issue #50 · terser/terser · GitHub

Bug report or Feature request?
Bug: 55x performance regression

Version (complete output of terser -V)

terser 3.7.6

Complete CLI command or minify() options used

terser --compress collapse_vars=true --output output.js index.js

terser input

Input is a module with many var defs, where each has a value that is a complex object. Original scenario was a webpack 4 bundle that had imported Font Awesome 5 icons.

This reproduction repo is a more minimal cleaned up demonstration.

Quick link to the input module from that repo.

terser output or error

This version of terser takes about 30 seconds to produce the bundle, depending on hardware. The output is correct, but this is very slow, and becomes significantly slower in other similar real-world scenarios.

Expected result

This should build in <1 second, depending on hardware. I've seen the same code build correctly as quickly as 0.4 seconds in some previous versions of uglify-js and uglify-es that use the same collapse_vars compression option.

I've timed my scenario against several snapshots of the terser code base and found that the performance has changed significantly as work on compress.js:collapse() has been done. For example:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4