The goal is to eliminate gratuitous copying from ImmutableCollection builders. In particular, ImmutableSet.Builder stores an ...
14 years, 1 month ago
(2012-05-19 15:45:02 UTC)
#2
The goal is to eliminate gratuitous copying from ImmutableCollection builders.
In particular, ImmutableSet.Builder stores an explicit Object[] internally,
which is deduped *in place* and used without any copying whatsoever if
a) the builder was initialized to exactly the right size (this will pay off more
as we expose initial builder capacity controls, and use it more internally)
b) no dups were found, so the entire Object[] consists of unique elements
Most of the payoff will come down the line with the compact collections rewrite.
On 2012/05/25 20:27:21, Chris Povirk wrote: > LGTM The CL is at http://code.google.com/r/wassermanlouis-guava/source/detail?r=ecd1b1715812b90a1ba4085379abd8dfea1f0abf&name=builder-arrays .
Somehow this made some reflect+testing tests flaky(!). I was looking in
completely the wrong place to fix them: The bug is actually in TypeToken, and I
have a fix. This CL will go in after it.
Issue 6210074: Optimize ImmutableCollection builders
(Closed)
Created 14 years, 1 month ago by Louis Wasserman
Modified 14 years ago
Reviewers: Chris Povirk
Base URL:
Comments: 2