-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Performance Improvements for files with thousands of tests #461
Conversation
…h every new test
This relies on some changes to |
Further splitting that test suite into multiple files (beaugunderson/emoji-aware#1):
|
I think this is left over from when we handled assertion tracking differently
The check for this is in the constructor now. It's not possible for `this.fn` to be undefined
This was a pretty significant performance increase: 5.3 -> 4.0 seconds
97d7eae
to
5f48185
Compare
@@ -72,6 +72,7 @@ test('fake timers do not break duration', function (t) { | |||
}); | |||
}); | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, destructuring would no longer work. This is not allowed anymore:
test({is, same} => {
is(1 + 1, 2);
same([1,2].slice(1), [2]);
});
You have to preserve the this reference:
test(t => {
t.is(1 + 1, 2);
t.same([1,2].slice(1), [2]);
});
👍 Looks good! (ᵔᴥᵔ) Too bad jamestalmage@4e23943 was slow. It was more readable. |
Yeah, unfortunately it is a big offender in this scenario. |
Also a technically breaking change (though not one I am really concerned about): t.is(1 + 1, 2); No longer returns a Promise. Only |
Me neither. |
Results look promising, let's get it in! |
Performance Improvements for files with thousands of tests
|
@kentcdodds, et. all Just for comparison - I also created a branch converting AVA now ekes out slightly better performance:
However, it's obvious the only reason AVA is winning is that it is leveraging multiple processes. Hopefully this means there are still lots of opportunities to make AVA even faster. |
Totally. If we could make ava as fast as mocha on a per-file basis then ava would scream with speed. This is making me feel really positive about the potential for ava :D |
Using the emoji-aware test-per-character branch as a benchmark, and running
time ava
:master:
this branch (only the
Runner
commits):this branch (all the commits):
updated benchmark (with empower-core performance tweaks):