harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Kuksenko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-3392) [Classlib][luni][performance] Improvement of java.lang.(Ineteger,Short,Long,Character).valueOf() methods
Date Wed, 14 Mar 2007 11:00:12 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Kuksenko updated HARMONY-3392:
-------------------------------------

    Attachment: luni_caches.patch

The patch improves performance of java.lang.*.valueOf methods due to unnecessary syncronization
removing.


> [Classlib][luni][performance] Improvement of java.lang.(Ineteger,Short,Long,Character).valueOf()
methods
> --------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3392
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3392
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>         Environment: All
>            Reporter: Sergey Kuksenko
>         Attachments: luni_caches.patch
>
>
> Performance optimization done for the methods:
> java.lang.Short.valueOf(), java.lang.Character.valueOf(),java.lang.Integer.valueOf(),
java.lang.Long.valueOf().
> Currently, small values are cached for these wrappers. Implementation of caching is rather
ineffective, because of presence of synchronization. If several threads creates wrappers (boxing)
it may cause unnecessary synchronization contention and performance degradation. Attached
patch contains correct modification of  "valueOf" methods, all unnecessary synchronizations
are removed.
> Also, it makes sense to remove object comparisons ("this==object") from "equals" methods.
For such small wrappers, it is much faster and easier to compare wrapped values without preliminary
reference comparison.
> Besides, the patch fixes HARMONY-2454 issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message