Skip to content

minifier: Performance regression: 2.5x slower minification with minor input size increase #17369

@IWANABETHATGUY

Description

@IWANABETHATGUY

Description

I've encountered a significant performance regression in oxc-minify where a file that is only ~6% larger takes 2.5x longer to minify.

Benchmark Results

File Input Size Output Size Compression Ratio Time
good.js 10176.62 KB 6781.65 KB 33.36% 282.31 ms
bad.js 10820.12 KB 6937.99 KB 35.88% 704.10 ms

Environment

  • oxc-minify version: 0.105.0
  • Platform: Windows (win32-x64-msvc)

Reproduction

  1. git clone https://github.com/IWANABETHATGUY/oxc-minify-performance-issue
  2. pnpm install

Files attached: good.js and bad.js

node minify-with-oxc.mjs ./good.js  # ~282ms
node minify-with-oxc.mjs ./bad.js   # ~704ms

Expected Behavior

Similar input sizes should result in similar minification times.

Actual Behavior

A 6% increase in input size causes a 150% increase in processing time, suggesting possible algorithmic complexity issues with certain code patterns.


Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions