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

introduce Kotlinx Benchmark tests (copied from #763) #904

Merged
merged 7 commits into from Aug 25, 2022

Conversation

aSemy
Copy link
Contributor

@aSemy aSemy commented Aug 25, 2022

copied from #763 - credit to @tmszdmsk!

I thought this was a good change, and I'm curious about investigating #13 and I think these benchmark tests can help.

I also refactored the existing 'client tests' to be in a new 'test modules' directory, because I think it's neater and more organised to have the test projects together, rather than mixed amongst the 'regular' projects.

…tmszdmsk)

refactor test projects to be in separate directory
@aSemy aSemy changed the title introduce Kotlinx Benchmark tests (copied from #763 - credit to @tmsz… introduce Kotlinx Benchmark tests (copied from #763) Aug 25, 2022
@aSemy aSemy marked this pull request as draft August 25, 2022 21:03
Copy link
Collaborator

@Raibaz Raibaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty interesting, thanks for putting it together!

test-modules/performance-tests/README.md Outdated Show resolved Hide resolved
@aSemy
Copy link
Contributor Author

aSemy commented Aug 25, 2022

I added some additional tests for context, and used https://jmh.morethan.io/ to visualise the results.

image

I don't think it's a surprise that the test without mocking/stubbing is very fast, but as commented here the stub decreases the operations, even though the stub isn't called.

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 25, 2022

Yep makes sense, as discussed in #13 the most expensive part is actually creating stubs rather than using them.

@aSemy aSemy marked this pull request as ready for review August 25, 2022 21:58
@aSemy
Copy link
Contributor Author

aSemy commented Aug 25, 2022

I think this PR can be merged in as-is. It's a good basis for future work, be it making the code better, or adding a GHA or visualizer plugin https://github.com/jzillmann/gradle-jmh-report

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 25, 2022

Yep I think the next steps about this would be adding a GHA to monitor performances and track potential hits.

Thanks a lot!

@Raibaz Raibaz merged commit cb83dee into mockk:master Aug 25, 2022
@aSemy aSemy deleted the feat/jmh_benchmark_tests branch August 25, 2022 22:04
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