cats-mtl icon indicating copy to clipboard operation
cats-mtl copied to clipboard

WIP: New special and bench modules + StateIO

Open LukaJCB opened this issue 7 years ago • 2 comments

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.

LukaJCB avatar Oct 12 '18 14:10 LukaJCB

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

LukaJCB avatar Oct 12 '18 15:10 LukaJCB

Codecov Report

Merging #86 into master will decrease coverage by 6.43%. The diff coverage is 0%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update 830e1e8...f74c937. Read the comment docs.

codecov-io avatar Oct 12 '18 20:10 codecov-io