This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 162690 [details] EnumSet.of.png It appears that there is huge performance difference between EnumSet.of() with EnumSet.noneOf().add() - the first one is roughly 3-4 times slower (because of inner call to Class.getSuperClass()) and in the amount of iterations for UsagesData.addUsage() this is rather significant difference in overall time. Attached is the 'proof-link' for another similar case in another module. Required change is rather minor void addUsage( @NonNull final T className, @NonNull final ClassIndexImpl.UsageType type) { Set<ClassIndexImpl.UsageType> usageType = usages.get (className); if (usageType == null) { usageType = EnumSet.of(type); usages.put (className, usageType); } else { usageType.add (type); } } --> void addUsage( @NonNull final T className, @NonNull final ClassIndexImpl.UsageType type) { Set<ClassIndexImpl.UsageType> usageType = usages.get (className); if (usageType == null) { usageType = EnumSet.noneOf(ClassIndexImpl.UsageType.class); usages.put (className, usageType); } usageType.add (type); }