Debugging cypress open performance #26684
Replies: 2 comments 4 replies
-
This is to do with something called v8 snapshots - we speed things up by sticking a bunch of commonly used modules in memory, so each
Something is definitely not right here, the Cypress repo itself has projects with 100s of specs and opens nice and quick - globbing for specs should be very fast. Can you share your migrated project's |
Beta Was this translation helpful? Give feedback.
-
As a workaround I can put cypress and the node modules in a subfolder:
Then it opens fast ... But we'd rather like to avoid that. UPDATED workaround
Now start cypress from this folder and it opens super-fast. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
EDIT Issue opened: #26691
I am not posting this as a bug, because I don't have a minimum reproducible example yet.
We recently upgraded from 9.6.0 to 12 and migrated the specs using the wizard. In 9.x we did not notice this slow
cypress open
performance.In a fresh Cypress project with 12.11.0 which I opened once, did not add any specs and closed it, and then I execute
DEBUG=cypress:* CYPRESS_BASE_URL=https://example.com yarn cypress:open --e2e --browser chrome
it takes less ~5 seconds for the "Create your first spec" be visible.In my migrated project with around 20 specs it takes 25 seconds (sometimes even ~ 45 seconds). This is really annoying as we are constantly switching the BASE URL and restart often.
We have some plugins installed (percy, deploysentinel) and a special fixture loader in the config, but this does not seem the one which takes long.
In the debug log I see the following:
With DEBUG=* there are lots and lots such lines during the time when nothing seems to happen:
Could that be the reason?
What does this mean?
What should I look for in our specs / plugins?
EDIT: I tried to make a minimal example by deleting most of the specs and config. Finally I replaced cypress/ and cypress.* by the working (fast) set of files from my fresh project to the project causing problems. Still the start up takes long.
So the reason must be somewhere else in the project.
Is cypress maybe scanning the full project for specs, not only cypress/ ? The project has quite a lot of other files (Magento)... 🤔
EDIT2: it seems to add watchers for each and every folder in the Magento project
Our project has ~ 176K files in 43K folders most of them are not related to Cypress:
What I did is to start cypress, pick the process ID of the CPU consuming Cypress process and called
The spits out tons of inotify adds:
Even if I use
there are still lots of statx calls on all my folders.
Beta Was this translation helpful? Give feedback.
All reactions