Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Java.util.BitSet VS java.util.EnumSet in terms of performance and memory

800151Oct 18 2011 — edited Oct 19 2011
Hi,

I am working on a optimization, we are currently evaluating to use either BitSet or EnumSet.

Has somebody encountered performance measuring between those types in terms of performance and memory?

I guess for example the method "isEmpty" of a EnumSet is much faster then programmatically testing if a BitSet is empty.

But in terms of internal memory consumption, is there any advice on those types? Is an EnumSet actually internally representated as BitSet?

Thanks
Sebastian
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 16 2011
Added on Oct 18 2011
2 comments
1,104 views