You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2007/03/14 13:37:09 UTC

[jira] Resolved: (HARMONY-3392) [Classlib][luni][performance] Improvement of java.lang.(Ineteger,Short,Long,Character).valueOf() methods

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

Alexey Petrenko resolved HARMONY-3392.
--------------------------------------

    Resolution: Fixed

The patch has been applied.
Please verify.

> [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
>         Assigned To: Alexey Petrenko
>         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.