#
5b5659a7 |
| 25-Mar-2017 |
Damjan Jovanovic |
Add some Java performance optimizations with boxing of basic types: instead of using "new <Type>(<value>)", use <Type>.valueOf(<value>), or better yet, rely on autoboxing. Since the
Add some Java performance optimizations with boxing of basic types: instead of using "new <Type>(<value>)", use <Type>.valueOf(<value>), or better yet, rely on autoboxing. Since the box objects are immutable, Java can and does cache them for values between -128 and 127, which includes all possible boolean and byte values and many common values for all other basic types. Thus, unlike the constructor, calling valueOf() or autoboxing such values does not allocate memory at all, and only returns the pre-existing instance, which is not only faster, but uses zero extra memory too. This is the first of many patches. This one fixes this problem in bridges, javaunohelper and jurt, which are parts of the Java<->Uno bridge, which is critical to performance. Patch by: me git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1788667 13f79535-47bb-0310-9956-ffa450edef68
show more ...
|