google / google/truth

In containsExactly, hash elements when we can

Open
#452 3 comments 0 reactions 0 assignees View on GitHub
P3 type=performance
Dominant language
Java
Stars
2.8k
Forks
275
Avg merge
7m
Merged PRs (30d)
4

Description

(This could improve performance in some cases.)

Currently, we avoid hashing in all cases, just in case it doesn't work for some objects. But hashing does work for the vast majority of objects, and it should make things faster when there's a lot of data (though potentially slower when there's only a little data and/or the hash function is slow...).

As of https://github.com/google/truth/commit/88d2ef32e1e05aba9102d2fa5f8050acaad5190f, hashing should be pretty easy to enable. But this is a low priority.

[Edit: If we do this, we probably want to rename "NonHashing"Multiset :)]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.