-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Map monoid performance #1290
Comments
For reference Cats creates a new mutable map and then wrap it as an immutable Map |
Algebird optimized this, but we seem to have misapplied the learnings here: we should only use the mutable map in the combineAll, which should be specific, not the generic one from Note algebird uses the immutable style for combine, but starts a new mutable map and updates that one for combineAll (sumOption). |
fixed by #1300 |
Cats's monoid instance for maps is extremely slow for the common use case where you're
foldMap
-ing over e.g. a collection of documents. For example, here's a simple benchmark where we add up 1000 singleton maps with 500 distinct keys:And Scalaz has ~100 times the throughput:
The text was updated successfully, but these errors were encountered: