Math check: it's not 0.5s/2000, it's 0.5ms/2000, which is around a quarter of a microsecond, which seems plausible

It also doesn't sound like a huge performance hit: you can do 4,000,000 of them in a second, which seems pretty small compared to the overall overhead of Thrift (not to mention any business logic).

--Jonathan

Ted Dunning wrote:
That last answer in the comment chain just asserts that this is the cost of
autoboxing.  It doesn't actually describe any measurements.

I think that is a made-up number.  I find it very hard to imagine that it
costs hundreds of microseconds to box or unbox an integer (0.5 s / 2000).

On Wed, Jul 15, 2009 at 4:51 PM, Bryan Duxbury <[email protected]> wrote:

there is some cost for sure but I did not do a real benchmark. When I did
search for it, I came across :
http://stackoverflow.com/questions/423704/java-int-or-integer/423856

the last answer indicate that auboxing 2000 Integer add 0.5 ms... yes it's
not much but if you are doing a lot of such operation it starts to adds up
especially on a server side web apps/web services.

Interesting. Would love to see if that measured up the same way in Thrift.





Reply via email to