commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Williams <...@lig.net>
Subject Re: [pool] replacing numeric/byte constants with Java5 enums
Date Mon, 25 Apr 2011 21:21:20 GMT
Note that, as of Android 2.2's Dalvik at least, that Java5 enums are much much slower than
using constants.  For anything that gets 
used frequently, and that might be used on Android, that is a problem.  I wrote and optimized
a SAX and DOM parser on Android.  
While the JDK will optimize out most of the overhead for enums and things like Character objects
rather than char, Dalvik won't 
(yet, as of 2.2 at least).

Another data point: For small sets with String as a key, TreeMap<> is much faster than
HashMap<>.  Makes sense when you think about 
it, but it was a surprise at the time.

Just FYI.

sdw

On 4/25/11 2:13 PM, Gary Gregory wrote:
> That would fall under the Java 5 umbrella, like generics, so that's OK with
> me for an ASAP pool2 release.
>
> Gary
>
> On Mon, Apr 25, 2011 at 4:40 PM, Simone Tripodi<simonetripodi@apache.org>wrote:
>
>> Hi all,
>> in the first pool2 attempt we agreed on replacing numeric/byte
>> constants with Java5 enums, do we agree on doing it also for first
>> pool2 release?
>> Thanks in advance!
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message