You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2014/03/18 17:04:49 UTC

[jira] [Commented] (WICKET-5535) Intern strings generated by Wicket that have bigger chance to be duplicated

    [ https://issues.apache.org/jira/browse/WICKET-5535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13939423#comment-13939423 ] 

Martin Grigorov commented on WICKET-5535:
-----------------------------------------

XmlTag has been improved earlier with commit https://github.com/apache/wicket/commit/0036f14c33ffb548cdc8adf9ebf17cec34a73c1f

> Intern strings generated by Wicket that have bigger chance to be duplicated
> ---------------------------------------------------------------------------
>
>                 Key: WICKET-5535
>                 URL: https://issues.apache.org/jira/browse/WICKET-5535
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 7.0.0
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>
> I've been doing some performance measurements recently and I've noticed that Wicket produces some higher number of String objects like:
> - small numbers ("1", "2", "3", ...) generated from repeaters' String.valueOf(nextId)
> - HTML element names/attributes ("span", "div", ...) generated in XmlTag#getName, #getAttribute, ...
> We can reduce memory usage for those by using String#intern().
> Since Java 7 the interned strings are stored in the Heap memory so this won't affect negatively the perm generation.
> Interned strings are GC-ed so this is also not a concern.
> http://java-performance.info/string-intern-in-java-6-7-8/ provides good explanation how to avoid the CPU penalty caused by String#intern() if needed.



--
This message was sent by Atlassian JIRA
(v6.2#6252)