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
htmlreporter: appendChild of a specDone only all 500ms #1904
Conversation
I appreciate the contribution, but this looks pretty broken in its current state. The tests fail in browsers, the postttest script fails on node, and the reporter crashes on startup because it tries to access Please read the contributing guide and pay special attention to the parts about testing. You should be able to reproduce the crash by running It would also help to know more a little more about the problem. What browser did you get those numbers from? Are your tests mostly synchronous our asynchronous? If you write tests for the new functionality, get it working, and fix the existing test failures, I'd be happy to take a look. Fair warning: it might take a while. This is an area where historically one person's optimization has been another person's performance regression, so I'll have to do a fair bit of manual testing. |
I adjusted the code a bit, but still need to adjust the tests.
The screenshot is from a stable Chrome v 89.0.4389.114
Most tests are sync ones. |
That sounds like a pretty similar workload to Jasmine's own test suite, so I'm surprised that you're seeing such worse performance than I am. If you run Jasmine's test suite in the same browser and click on a single test (so that HTML rendering should dominate the run time), how long does it take? |
Even with jasmine own tests suite faster-display branch (1.8 sec for the painting block) main branch (3.2 sec for the painting block) Probably my own tests could be optimized for not running 😀 but I take every improvement. |
Fixed the current unit tests and added test to the delay. |
Sorry, but there are still some problems with this.
The IE syntax error and the second lint error are both because you're using Javascript features (particularly arrow functions and promises) that don't exist on all of the browsers that Jasmine runs on. Jasmine code needs to be written in straight ES5 with no newer language or library features, except in certain specific situations. To speed up the tests, please use the mock clock instead of I'd also like to see the delay dropped from 500ms to something smaller, like 100ms or less. 500ms is visibly jerky, and I can't measure a noticeable difference between 500ms and 100ms over 5000 dots in any browser except Safari. |
Thanks again for your feedback. Sorry for ignoring jasmine.clock till now. This was really easy. |
This is getting closer but it's not quite there yet. The
You can fix the formatting problems by running |
Closing due to inactivity, and because I can no longer reproduce any performance improvement with this patch. On the hardware & browsers that I currently have access to, debouncing makes things less smooth but no faster. I suspect that whatever improvements were to be had here have been overtaken by improvements in browsers. |
Description
appendChild with all success full spec costs time because it forces the browser to rerender every dot.
Motivation and Context
Ran 2 of 4822 specs => 27 seconds with the main branch
Screenshot from devtools performance trace shows constant "layout", "update layer tree", "paint":
Ran 2 of 4822 specs => 12 seconds with this branch
Screenshot from devtools performance trace shows "layout", "update layer tree", "paint" only every 500ms:
How Has This Been Tested?
Ran many tests with success and failures.
Types of changes
Checklist: