Skip to content

Conversation

@merkste
Copy link

@merkste merkste commented Sep 27, 2016

This pull request reduces memory strain and improves performance by avoiding the creation of duplicated primitive wrapper objects. To achieve this it exploits a) Java's built-in caches, e.g., IntegerCache (configure: -XX:AutoBoxCacheMax=) and b) auto-boxing.

@merkste merkste changed the title Optimize boxing Optimize primitive boxing Sep 27, 2016
Steffen Märcker added 5 commits October 10, 2016 16:14
In order to avoid the creation of multiple Integer instances, use
Integer#valueOf instead of Integer#new. This reduces memory and gc load.
In order to avoid the creation of multiple instances of true/false, use
Boolean#valueOf instead of Boolean#new. This reduces memory and gc load.
These changes remove some superfluous boxing/unboxing operations
and prepare for future JVM optimization similar to the Integer cache.
These changes help to exploit the Long cache.
@merkste
Copy link
Author

merkste commented Oct 10, 2016

I changed the comparator in JDDVars#sortByIndex in commit ae6b076 to avoid over/underflow, thanks @kleinj.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant