MSW handlers and JSDOM can be very slow #2141
Closed
tkrotoff
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Hi, @tkrotoff. There's nothing MSW can or should do about this. We are not doing URL parsing, it's something JSDOM ( |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
JSDOM/whatwg-url is slow to parse URLs with long query string.
jsdom/jsdom#3712
This repo is an example with 500 MSW handlers: https://github.com/tkrotoff/jsdom-slow-URL-parsing
Results (MacBook Pro 16" M1, macOS 14.4.1, Node.js v20.12.1):
Vitest
environment: 'node'
Vitest
environment: 'happy-dom'
Vitest
environment: 'jsdom'
Vitest
environment: 'jsdom'
+ whatwg-url patchedHere is the dirty patch:
On our internal application (react-testing-library, jsdom, Vitest, MSW), we have seen tremendous performance increase on our CI thanks to this dirty patch.
Beta Was this translation helpful? Give feedback.
All reactions