-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test is 6x slower in 3.3.2 with cy:open #26
Comments
hasBinary recurses through all the keys on the object that's sent through the websocket, so one potential optimization would be to serialize the object (ie, with JSON.stringify) before sending it through the websocket if you already know it's just a plain JavaScript object. |
Some ideas to improve performance:
Meanwhile, need to add a warning to this plugin that it WILL affect the test performance due to instrumentation and saving the data |
I just want to add that in 3.3.1, there is a performance impact but it is more like 25%. Now, it is like 500%... |
Any updates on 3.4.0? |
I don't think 3.4.0 would make any difference |
I have my own code coverage plugin with cypress and just hit this issue. with our code base the task takes way over 60 seconds just to try to send the data. I'm not sure thats a great performance metric on the cypress side. using |
The slowdown comes from the changes introduced in cypress-io/cypress#4407, which allows circular references to be sent over the websocket. There is probably room for optimization in the normalization steps to improve this. Created an issue: cypress-io/cypress#4713 In the meantime, serializing the message manually (with |
Where exactly does |
You have to replace the and adjust the concrete task accordingly (to parse the now given string to json) this fixed my issues with the performance in 3.4.0. |
Workaround for cypress-io#26
Is this issue currently being worked on? |
🎉 This issue has been resolved in version 1.10.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@bahmutov You could consider updating the README to reflect the resolution. |
I would a pull request for this ;)
…Sent from my iPhone
On Mar 9, 2020, at 12:12, Henrik Feldt ***@***.***> wrote:
@bahmutov You could consider updating the README to reflect the resolution.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@jfaissolle commented on Fri Jun 28 2019
Current behavior:
With
cypress open
, running a single spec:Running in 3.3.1 takes 21 seconds.
Running in 3.3.2 takes 117 seconds.
Most CPU is consumed by the
hasBinary
function.Desired behavior:
Perfomance at least as good as 3.3.1 with cypress open.
Versions
Cypress 3.3.1 on Ubuntu 18.04.2, Chrome 75.0.3770.100
@flotwig commented on Fri Jun 28 2019
Hey @jfaissolle, could you share the spec code that is taking longer in 3.3.2? We made performance improvements in 3.3.2, but it looks like you're hitting a new edge case caused by #4407.
@jfaissolle commented on Mon Jul 01 2019
I have found that the slowdown happens with
@cypress/code-coverage
on. If I disable the plugin, tests perform as fast as in 3.3.1.Here is an example of test.
@bahmutov commented on Mon Jul 01 2019
@jfaissolle yes, it can quite possibly be due to
code-coverage
plugin, because it combines the code coverage after each test with previous results - which includes loading a JSON file, merging it, saving updated JSON file. These are slow file operations and can be super slow for large applications where the coverage object is large. I wonder ifhasBinary
gets triggered when we usecy.task
to send coverage info from the plugin to the Node process here https://github.com/cypress-io/code-coverage/blob/master/support.js and if we can pass a flag to NOT verify it (we know the object to be good for example)The text was updated successfully, but these errors were encountered: