Re: RFR: Optimize StringBuilder.append(null)

2013-04-08 Thread Martin Buchholz
On Thu, Mar 28, 2013 at 10:47 AM, Jim Gish wrote: > Thanks, Martin, > > We've all heard of code "smells" -- I hereby dub this a code "chuckle" :-) > > The change looks good to me otherwise as well. > Committed - thanks for the reviews!

Re: RFR: Optimize StringBuilder.append(null)

2013-04-08 Thread Martin Buchholz
On Wed, Mar 27, 2013 at 11:32 PM, Remi Forax wrote: > On 03/28/2013 07:29 AM, Martin Buchholz wrote: > > The declaration saves 50 bytes of bytecode. >> > > I don't understand ? > Copying a field into a method local results in fewer bytes of bytecode, which may tickle hotspot into inlining the

Re: RFR: Optimize StringBuilder.append(null)

2013-03-28 Thread Jim Gish
Thanks, Martin, We've all heard of code "smells" -- I hereby dub this a code "chuckle" :-) The change looks good to me otherwise as well. Thanks, Jim On 03/28/2013 12:05 PM, Martin Buchholz wrote: I took Laurent's suggestion of renaming count to c, even though the result looks like a valu

Re: RFR: Optimize StringBuilder.append(null)

2013-03-28 Thread Martin Buchholz
I took Laurent's suggestion of renaming count to c, even though the result looks like a value judgement on a competing programming environment: value[c++] = 'n'; value[c++] = 'u'; value[c++] = 'l'; value[c++] = 'l'; On Wed, Mar 27, 2013 at 11:42 PM, Laurent Bourg

Re: RFR: Optimize StringBuilder.append(null)

2013-03-27 Thread Laurent Bourgès
Maybe the local var count could be renamed _count or c to avoid name conflict with the member count and make the code more readable / obvious. PS: I like final vars. Cheers Laurent Le 28 mars 2013 07:31, "Martin Buchholz" a écrit : > > On Wed, Mar 27, 2013 at 4:36 PM, Remi Forax wrote: > > > On

Re: RFR: Optimize StringBuilder.append(null)

2013-03-27 Thread Remi Forax
On 03/28/2013 07:29 AM, Martin Buchholz wrote: On Wed, Mar 27, 2013 at 4:36 PM, Remi Forax > wrote: On 03/27/2013 03:01 AM, Martin Buchholz wrote: Hi Martin, the code looks good, I've just noticed that you declare the char array value final in a

Re: RFR: Optimize StringBuilder.append(null)

2013-03-27 Thread Martin Buchholz
On Wed, Mar 27, 2013 at 4:36 PM, Remi Forax wrote: > On 03/27/2013 03:01 AM, Martin Buchholz wrote: > > Hi Martin, > the code looks good, > I've just noticed that you declare the char array value final in appendNull > but it's not something that is usually done in the java.lang codebase. > It's

Re: RFR: Optimize StringBuilder.append(null)

2013-03-27 Thread Remi Forax
Forwarded conversation Subject: RFR: Optimize StringBuilder.append(null) From: *Martin Buchholz* Date: Tue, Mar 26, 2013 at 1:54 PM To: Xueming Shen , Masayoshi Okutsu < masayoshi.oku...@oracle.com>, Ulf Zibis , Mike Duigou < mike.dui...@oracle.com> Hi! It'

RFR: Optimize StringBuilder.append(null)

2013-03-26 Thread Martin Buchholz
Oops: I forgot to include core-libs-dev Forwarded conversation Subject: RFR: Optimize StringBuilder.append(null) From: *Martin Buchholz* Date: Tue, Mar 26, 2013 at 1:54 PM To: Xueming Shen , Masayoshi Okutsu < masayoshi.oku...@oracle.com>, Ulf Zibis , Mike