rspack icon indicating copy to clipboard operation
rspack copied to clipboard

perf: matching module rule using regex is slow

Open Boshen opened this issue 2 years ago • 2 comments

System Info

No response

Details

image

With lots of modules and lots of rules, this quickly becomes a performance bottleneck.

Reproduce link

No response

Reproduce Steps

No response

Boshen avatar Feb 20 '23 11:02 Boshen

regress(current using) is relatively slower than regex. But there are inconsistencies between regex and javascript regex.

hyf0 avatar Feb 21 '23 06:02 hyf0

We should be able to add a fast path or cache here, because it is mostly running a small regex such as .css$ on a whole directory path.

Boshen avatar Feb 21 '23 06:02 Boshen