On Aug 20, 1:09 am, Kenton Varda <
ken...@google.com> wrote:
> On Wed, Aug 19, 2009 at 3:00 PM, pwr <
daniel.pa...@gmail.com> wrote:
> > In 2.1, one could build() multiple objects in sequence, with the same
> > builder object, by clear()ing it repeatedly.
>
> No, you couldn't, at least according to the docs.
Weeeell, you could. Or I found myself into a few lucky corner
cases :).
> As the docs say, once you call build(), the builder is no longer usable.
I have to admit I didn't read the docs that thoroughly. They do say
so.
> The fact that it seemed to work with 2.1.0 and earlier was a mistake, and
> officially allowing this behavior would limit our ability to implement
> certain features and optimizations in the future. In particular there was
> an optimization involving putting builders on a freelist which seemed to
> improve performance on Android -- though this was removed just before the
> 2.2.0 release due to other problems.
>
> Sorry for the inconvenience. However, note that there is very little to
> gain by reusing a single builder object in this way, since the object is
> very small (just a pointer). Allocating a new builder for every iteration
> should not significantly harm performance.
Noted.
Thanks for the reply,
-pwr