Describe the bug
For some reason my testsuite runs significant slower with 7.2.4 compared to 7.2.3.
7.2.3:
real 0m14,750s
user 0m17,557s
sys 0m1,412s
````
7.2.4
real 0m54,398s
user 1m0,317s
sys 0m3,563s
```
To Reproduce
Execute unittests using mocha framework.
Expected behavior
No significant difference degrade between 7.2.4 compared to 7.2.3
Context (please complete the following information):
Additional context
It's a closed source project therefore I can't share my tests. If you have any pointers what other info I should provide or what to test let me know.
My first guess is this change. Can you investigate a little?
Sure, I will take a closer look during the next days.
While I think it might be due to upping the lolex version (or some other package): https://github.com/sinonjs/sinon/commit/1431c78cc3ffc0c13bbb8155080ccf14d42af4a0
Looks like @mantoni was correct. I digged a little deeper and it seems that the change in spy#resetHistory is the main contributor of the degradation in my setup.
I have two solutions in mind here:
spy#createProxy()) - as a result no extend.nonEnum() is needed in resetHistory() as no new properties will be added thereresetHistory() instead all of themI think (1) would be the cleaner approach with an additional benefit to have always the same object layout which helps v8 to create better assembly code.
I created #1984 with a fix proposal.
Sorry for the regression introduced by my PR, thanks for fixing it and also adding some tests!
@Flarna for completeness, would you mind posting some numbers using the new [email protected]?
Here are the results of the day, sinon 7.2.5 seems to be not available yet on NPM so I used SHA d0c073c2aeaebab276094600d76d178d52158500 which should be the same:
7.2.3
real 0m15,699s
user 0m18,323s
sys 0m1,731s
real 0m15,932s
user 0m18,427s
sys 0m1,669s
7.2.4
real 0m54,554s
user 1m0,454s
sys 0m3,466s
real 0m54,659s
user 1m0,806s
sys 0m3,292s
sinonjs/sinon#d0c073c2aeaebab276094600d76d178d52158500
real 0m16,752s
user 0m19,516s
sys 0m1,767s
real 0m16,460s
user 0m19,514s
sys 0m1,676s
sinon 7.2.5 seems to be not available yet on NPM
I've published it now :)
Thank you for the update. Those results look to be well enough in the same ballpark for be usable 馃憤
Most helpful comment
Looks like @mantoni was correct. I digged a little deeper and it seems that the change in
spy#resetHistoryis the main contributor of the degradation in my setup.I have two solutions in mind here:
spy#createProxy()) - as a result noextend.nonEnum()is needed inresetHistory()as no new properties will be added thereresetHistory()instead all of themI think (1) would be the cleaner approach with an additional benefit to have always the same object layout which helps v8 to create better assembly code.