--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
I think that those would do the heavy lifting for us :)
Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and
complete, not lacking anything." -James 1:4
mlaverd.theunixplace.com/blog
/"\
\ / ASCII Ribbon Campaign
X against HTML e-mail
/ \
2010/6/24 Kenton Varda <ken...@google.com>:
I think you could re-implement whatever those libraries we talked
about are doing. Conceptually it is very simple, but I'm pretty sure
that you must have a bunch of tricky things for performance to be
careful.
So a naive implementation (with memcpys) could be done in a day I
think. A more solid implementation (no memcpys) might take another
day. More optimizations: no clue.
But this is going to be very very boilerplate-like. It might be nice
to have a code generator (something as simple as StringTemplate). It
would save you a lot of time.
Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and
complete, not lacking anything." -James 1:4
mlaverd.theunixplace.com/blog
/"\
\ / ASCII Ribbon Campaign
X against HTML e-mail
/ \
2010/6/29 Kenton Varda <ken...@google.com>:
But we probably will need to keep the old interface as wrapper or something...
I think that, for the sake of saving many hours, one could prototype
using the Apache stuff. If the benchmarks are good, then we can think
about porting it and tweaking to fit our needs better. That might be
more enjoyable than tweaking GC settings :)
Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and
complete, not lacking anything." -James 1:4
mlaverd.theunixplace.com/blog
/"\
\ / ASCII Ribbon Campaign
X against HTML e-mail
/ \
2010/6/30 Josh Hartman <atomi...@gmail.com>:
I think the problem is that in the empty case, the next call to add*
will re-create the ArrayList as empty, which defeats the call to
ensureCapacity. Try hacking something in that method to make this work
(check the type?)
Evan
--
Evan Jones
http://evanjones.ca/
On Jun 29, 2010, at 17:49 , Josh Hartman wrote:
"public Builder ensure$capitalized_name$Capacity(int minCapacity) {\n"
" if (result.$name$_.isEmpty()) {\n"
" result.$name$_ = new java.util.ArrayList<$boxed_type$>(minCapacity);\n"
--