Tag Archives: Performance

Autoboxing Performance

Preface Because of my previous post about autoboxing I get many search queries about autoboxing performance. Now I’m curious, too. So let’s get ready for some benchmarks. When we talk about boxing performance, then we always have two sides. Throughput … Continue reading

Posted in Java, Performance | Tagged , , , , | 2 Comments

Autoboxing: Traps and Advantages

What is ‘autoboxing’ some people might ask? Autoboxing is a feature, which was added in Java 5. Autoboxing is the automatic conversion of primitive data types like int, double, long, boolean to its wrapper Object Integer, Double… and vice versa. … Continue reading

Posted in common practice, Java, Performance, Uncategorized | Tagged , , , , | Leave a comment

The costs of String concatenation (+) or what String appending really does

String concatenation (e.g. “fu” + “bar”) are for most developers a mystery what it really does. The simple case Something like will usually be appended at compile time. So if you decompile this you see: The final case What happens … Continue reading

Posted in common practice, Formatting, Java, Performance | Tagged , , , , | Leave a comment

Java Performance Tuning with maximizing Integer.valueOf(int)

With http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#valueOf%28int%29 or auto boxing(uses internal a valueOf too) the cached Integer values will be used if they are between -127 and +128. Now I found coincidentally(by looking at the source) on a Java feature or more exactly on a … Continue reading

Posted in common practice, Performance | Tagged , , , | 1 Comment