cats-mtl
cats-mtl copied to clipboard
WIP: New special and bench modules + StateIO
Should address #80 for now.
StateIO uses a Ref to make state updates more performant.
A simple benchmark included in this PR shows this so far:
[info] Benchmark Mode Cnt Score Error Units
[info] StateBench.leftAssociatedBindSpecial thrpt 10 297.506 ± 13.396 ops/s
[info] StateBench.leftAssociatedBindStateT thrpt 10 107.687 ± 3.500 ops/s
next step might be to newtype it, to avoid boxing.
Hmm, turning it into a newtype somehow degraded performance of flatMap a bit
[info] Benchmark Mode Cnt Score Error Units
[info] StateBench.leftAssociatedBindSpecial thrpt 10 234.863 ± 12.094 ops/s
[info] StateBench.leftAssociatedBindStateT thrpt 10 106.308 ± 3.421 ops/s
Codecov Report
Merging #86 into master will decrease coverage by
6.43%. The diff coverage is0%.
@@ Coverage Diff @@
## master #86 +/- ##
==========================================
- Coverage 91.09% 84.65% -6.44%
==========================================
Files 63 64 +1
Lines 539 580 +41
Branches 3 3
==========================================
Hits 491 491
- Misses 48 89 +41
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...cial/src/main/scala/cats/mtl/special/StateIO.scala | 0% <0%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 830e1e8...f74c937. Read the comment docs.