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

Optimize the foldM implementation for Vector #2552

Merged
merged 1 commit into from
Oct 4, 2018

Conversation

ceedubs
Copy link
Contributor

@ceedubs ceedubs commented Oct 4, 2018

I've also added a benchmark to compare the new implementation with the
old. Here are the results that I got on my computer when running
bench/jmh:run -i 10 -wi 10 -f1 -t1 .*FoldBench\.vector.*:

Benchmark                     Mode  Cnt        Score       Error  Units
FoldBench.vectorIndexFoldM   thrpt   10  1185138.829 ± 45633.259  ops/s
FoldBench.vectorToListFoldM  thrpt   10   817330.438 ± 21998.851  ops/s

I've also added a benchmark to compare the new implementation with the
old. Here are the results that I got on my computer when running
`bench/jmh:run -i 10 -wi 10 -f1 -t1 .*FoldBench\.vector.*`:

```
Benchmark                     Mode  Cnt        Score       Error  Units
FoldBench.vectorIndexFoldM   thrpt   10  1185138.829 ± 45633.259  ops/s
FoldBench.vectorToListFoldM  thrpt   10   817330.438 ± 21998.851  ops/s
```
Copy link
Contributor

@kailuowang kailuowang left a comment

Choose a reason for hiding this comment

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

thanks! pending build green

@codecov-io
Copy link

codecov-io commented Oct 4, 2018

Codecov Report

Merging #2552 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2552      +/-   ##
==========================================
+ Coverage   95.17%   95.18%   +<.01%     
==========================================
  Files         359      359              
  Lines        6555     6558       +3     
  Branches      273      285      +12     
==========================================
+ Hits         6239     6242       +3     
  Misses        316      316
Impacted Files Coverage Δ
core/src/main/scala/cats/instances/vector.scala 100% <100%> (ø) ⬆️

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 5bbe08d...b98526a. Read the comment docs.

@LukaJCB LukaJCB merged commit b06d07c into typelevel:master Oct 4, 2018
@LukaJCB
Copy link
Member

LukaJCB commented Oct 4, 2018

Nice work, thanks @ceedubs! :)

@kailuowang kailuowang added this to the 1.5 milestone Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants