Skip to content
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 Exceptions on the JVM #1787

Merged
merged 1 commit into from Oct 19, 2020

Conversation

U1F984
Copy link
Contributor

@U1F984 U1F984 commented Oct 19, 2020

For our usecase we have lots of exceptions being created by shouldBe and similar. We noticed that a lot of time was being spent in class loading. Since it is unlikely the availability of the JUnit 4/5 Assertion classes will change during runtime we can cache the class and constructor lookup.

Our test suite now runs in 45 seconds instead of 85, which I would consider a worthwhile improvement.

For our usecase we have lots of exceptions being created by `shouldBe` and similar. We noticed that a lot of time was being spent in class loading. Since it is unlikely the availability of the JUnit 4/5 Assertion classes will change during runtime we can cache the class and constructor lookup. 

Our test suite now runs in 45 seconds instead of 85, which I would consider a worthwhile improvement.
@sksamuel
Copy link
Member

Nice improvement. Will merge once green.

@sksamuel sksamuel merged commit 82b6024 into kotest:master Oct 19, 2020
@sksamuel sksamuel added this to the 4.4 milestone Oct 19, 2020
@sksamuel sksamuel mentioned this pull request Oct 19, 2020
43 tasks
@U1F984 U1F984 deleted the patch-1 branch October 20, 2020 09:20
sksamuel pushed a commit that referenced this pull request Oct 31, 2020
For our usecase we have lots of exceptions being created by `shouldBe` and similar. We noticed that a lot of time was being spent in class loading. Since it is unlikely the availability of the JUnit 4/5 Assertion classes will change during runtime we can cache the class and constructor lookup. 

Our test suite now runs in 45 seconds instead of 85, which I would consider a worthwhile improvement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants