harmony-commits mailing list archives

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

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

Alexey Varlamov commented on HARMONY-3392:
------------------------------------------

I vote to do the same fix for all boxed types. Alexey, will you?

> [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.


Mime
View raw message