experimentalSourceRewriting
performance bottleneck
#29438
Labels
type: duplicate
This issue or pull request already exists
Current behavior
I'm observing a ~350x (not percentage!) performance overhead when enabling
experimentalSourceRewriting
on an entrypoint containing ElkJS. That entrypoint file is large, especially because of its source mapping segment.This causes the loading time of this file to go from ~300ms to ~110s, causing tests to fail due to timeouts. This wasn't immediately clear, as it takes so enormously long to load.
Desired behavior
Even with such large files,
experimentalSourceRewriting
shouldn't cause that much overhead. I suppose it doesn't handle the source mapping line particularly well, but there should be avenues to avoid this performance cliff.Test code to reproduce
Here's the file for which loading takes a 350x performance hit.
elkjs-entrypoint.zip
Cypress Version
13.7.1
Node version
20.12.0
Operating System
Windows 10 22H2 (19045.4170)
Debug Logs
No response
Other
I suspect it will be easiest to excercise the source rewriter with the attached JS file in a unit test to reproduce. Happy to provide additional defails if needed. I've omitted further debug logging for now but I can reproduce in that mode and share if desired.
The text was updated successfully, but these errors were encountered: