-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Flow.flattenMerge benchmark #1464
Conversation
benchmarks/src/jmh/kotlin/benchmarks/flow/FlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
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.
Great work! However, it requires some minor changes. Please see the comments.
Please, resolve conversations when they are resolved, and send pull requests for review here on GitHub when you want this.
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/plots-generators/generate-flatten-merge-flow-plots.py
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlowFlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlowFlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
c0421c8
to
f849d00
Compare
benchmarks/src/jmh/kotlin/benchmarks/flow/FlowFlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlowFlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlowFlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
|
||
import java.util.concurrent.ThreadLocalRandom | ||
|
||
fun doGeomDistrWork(work: Int) { |
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.
Have you verified that this function actually behaves like a geometric distribution when it is stressed on JVM?
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.
I've tested this function on different means, and created histograms of execution times. You can see the code here https://gist.github.com/fmixing/badbfc029e154486c8766ab9cc70a2a6
benchmarks/src/jmh/kotlin/benchmarks/flow/FlowFlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlowFlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
benchmarks/src/jmh/kotlin/benchmarks/flow/FlowFlattenMergeBenchmark.kt
Outdated
Show resolved
Hide resolved
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.
Great work!
This benchmark measures the performance of both
Flatten.flattenMerge
andSemaphore
performance.