You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Nikita Tovstoles (JIRA)" <ji...@apache.org> on 2010/02/13 00:55:27 UTC

[jira] Created: (WICKET-2741) non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap
----------------------------------------------------------------------------------

                 Key: WICKET-2741
                 URL: https://issues.apache.org/jira/browse/WICKET-2741
             Project: Wicket
          Issue Type: Bug
    Affects Versions: 1.4.6
            Reporter: Nikita Tovstoles


The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load. 
* RequestListenerInterface.interfaces
* WebApplication.addBufferedResponse
* Injector.inject() - 'cache' field. 

The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)

Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:

{noformat}
+--------------------------------------------------------------------------------------+------------------+-----------------+
|                                         Name                                         |    Time (ms)     |      Count      |
+--------------------------------------------------------------------------------------+------------------+-----------------+
|  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
|  | |                                                                                 |                  |                 |
|  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
|  | |                                                                                 |                  |                 |
|  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
|  |                                                                                   |                  |                 |
|  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
|    |                                                                                 |                  |                 |
|    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
|      |                                                                               |                  |                 |
|      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
|        |                                                                             |                  |                 |
|        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
|        |                                                                             |                  |                 |
|        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
|        |                                                                             |                  |                 |
|        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
|        |                                                                             |                  |                 |
|        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
+--------------------------------------------------------------------------------------+------------------+-----------------+

Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
{noformat}


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


[jira] Updated: (WICKET-2741) non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

Posted by "Nikita Tovstoles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nikita Tovstoles updated WICKET-2741:
-------------------------------------

    Component/s: wicket

> non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2741
>                 URL: https://issues.apache.org/jira/browse/WICKET-2741
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>            Reporter: Nikita Tovstoles
>
> The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load. 
> * RequestListenerInterface.interfaces
> * WebApplication.addBufferedResponse
> * Injector.inject() - 'cache' field. 
> The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)
> Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:
> {noformat}
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |                                         Name                                         |    Time (ms)     |      Count      |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
> |  |                                                                                   |                  |                 |
> |  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
> |    |                                                                                 |                  |                 |
> |    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
> |      |                                                                               |                  |                 |
> |      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
> |        |                                                                             |                  |                 |
> |        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
> {noformat}

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


[jira] Updated: (WICKET-2741) non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

Posted by "Stefan Fussenegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Fussenegger updated WICKET-2741:
---------------------------------------

    Attachment: wicket-2741.patch

this patch uses a copy-on-write approach to avoid synchronization for reads. Only in the rare event of a yet unmapped ClassLoader it's going to be a bit slower. While the patch seems to work very well a second or third pair of eyes would be very well appreciated. 

This patch also contains changes by patch for WICKET-2875 and reuses an empty array (new Field[0]) for classes without any injectable fields.

> non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2741
>                 URL: https://issues.apache.org/jira/browse/WICKET-2741
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>            Reporter: Nikita Tovstoles
>         Attachments: wicket-2741.patch
>
>
> The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load. 
> * RequestListenerInterface.interfaces
> * WebApplication.addBufferedResponse
> * Injector.inject() - 'cache' field. 
> The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)
> Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:
> {noformat}
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |                                         Name                                         |    Time (ms)     |      Count      |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
> |  |                                                                                   |                  |                 |
> |  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
> |    |                                                                                 |                  |                 |
> |    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
> |      |                                                                               |                  |                 |
> |      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
> |        |                                                                             |                  |                 |
> |        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
> {noformat}

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


[jira] Resolved: (WICKET-2741) non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2741.
-----------------------------------

         Assignee: Igor Vaynberg
    Fix Version/s: 1.4.9
                   1.5-M1
       Resolution: Fixed

> non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2741
>                 URL: https://issues.apache.org/jira/browse/WICKET-2741
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>            Reporter: Nikita Tovstoles
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.9, 1.5-M1
>
>         Attachments: wicket-2741.patch
>
>
> The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load. 
> * RequestListenerInterface.interfaces
> * WebApplication.addBufferedResponse
> * Injector.inject() - 'cache' field. 
> The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)
> Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:
> {noformat}
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |                                         Name                                         |    Time (ms)     |      Count      |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
> |  |                                                                                   |                  |                 |
> |  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
> |    |                                                                                 |                  |                 |
> |    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
> |      |                                                                               |                  |                 |
> |      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
> |        |                                                                             |                  |                 |
> |        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
> {noformat}

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


[jira] Commented: (WICKET-2741) non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833784#action_12833784 ] 

Johan Compagner commented on WICKET-2741:
-----------------------------------------

cant we just copy the specific ConcurrentMap impl we need from google code and add it to our own package?

Else we could just use a ConcurrentHashMap and then use WeakReference keys ourself (but then we need to make sure that we clean it now and then)

> non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2741
>                 URL: https://issues.apache.org/jira/browse/WICKET-2741
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>            Reporter: Nikita Tovstoles
>
> The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load. 
> * RequestListenerInterface.interfaces
> * WebApplication.addBufferedResponse
> * Injector.inject() - 'cache' field. 
> The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)
> Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:
> {noformat}
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |                                         Name                                         |    Time (ms)     |      Count      |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
> |  |                                                                                   |                  |                 |
> |  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
> |    |                                                                                 |                  |                 |
> |    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
> |      |                                                                               |                  |                 |
> |      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
> |        |                                                                             |                  |                 |
> |        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
> {noformat}

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


[jira] Commented: (WICKET-2741) non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833403#action_12833403 ] 

Juergen Donnerstag commented on WICKET-2741:
--------------------------------------------

Obviously with Inspector we can not simple replace Collections.synchronizedMap(new WeakHashMap()) with ConcurrentWeakHashMap since such a class does not exist. And we don't want to add a dependency on a 3rd party library just for that purpose. Since you seem to have all the tests and tools properly set up to validate, may be you could also provide a patch. I'm more than happy to apply it later on to the repository.

Thanks for your help

Juergen

> non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2741
>                 URL: https://issues.apache.org/jira/browse/WICKET-2741
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>            Reporter: Nikita Tovstoles
>
> The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load. 
> * RequestListenerInterface.interfaces
> * WebApplication.addBufferedResponse
> * Injector.inject() - 'cache' field. 
> The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)
> Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:
> {noformat}
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |                                         Name                                         |    Time (ms)     |      Count      |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
> |  |                                                                                   |                  |                 |
> |  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
> |    |                                                                                 |                  |                 |
> |    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
> |      |                                                                               |                  |                 |
> |      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
> |        |                                                                             |                  |                 |
> |        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
> {noformat}

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


[jira] Commented: (WICKET-2741) non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833606#action_12833606 ] 

Juergen Donnerstag commented on WICKET-2741:
--------------------------------------------

It's not that we are completely against it, but we careful in adding dependencies. A rule which we treat more strict for wicket-core than subproject such as wicket-spring. But if there is a good reason to add a lib, we'll do.

Since we are using maven, it's a clear benefit if that lib is available via a maven repository (such as http://repo2.maven.org/maven2/com/google/collections/google-collections/)

> non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2741
>                 URL: https://issues.apache.org/jira/browse/WICKET-2741
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>            Reporter: Nikita Tovstoles
>
> The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load. 
> * RequestListenerInterface.interfaces
> * WebApplication.addBufferedResponse
> * Injector.inject() - 'cache' field. 
> The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)
> Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:
> {noformat}
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |                                         Name                                         |    Time (ms)     |      Count      |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
> |  |                                                                                   |                  |                 |
> |  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
> |    |                                                                                 |                  |                 |
> |    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
> |      |                                                                               |                  |                 |
> |      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
> |        |                                                                             |                  |                 |
> |        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
> {noformat}

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


[jira] Commented: (WICKET-2741) non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

Posted by "Nikita Tovstoles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833593#action_12833593 ] 

Nikita Tovstoles commented on WICKET-2741:
------------------------------------------

OK. I've found another perf issue with @SpringBean. Switching back to a locator pattern (injecting beans into WebApplication bean only) improved throughput 5x @ 20 concurrent users. I am happy to help, but would need to understand your reluctance to use a 3rd party library, given the current perf impact. For the above, Google Collections' [MapMaker|http://google-collections.googlecode.com/svn/trunk/javadoc/index.html?com/google/common/collect/MapMaker.html] looks like a solid fit.

> non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2741
>                 URL: https://issues.apache.org/jira/browse/WICKET-2741
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>            Reporter: Nikita Tovstoles
>
> The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load. 
> * RequestListenerInterface.interfaces
> * WebApplication.addBufferedResponse
> * Injector.inject() - 'cache' field. 
> The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)
> Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:
> {noformat}
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |                                         Name                                         |    Time (ms)     |      Count      |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
> |  |                                                                                   |                  |                 |
> |  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
> |    |                                                                                 |                  |                 |
> |    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
> |      |                                                                               |                  |                 |
> |      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
> |        |                                                                             |                  |                 |
> |        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
> {noformat}

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


[jira] Commented: (WICKET-2741) non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868861#action_12868861 ] 

Hudson commented on WICKET-2741:
--------------------------------

Integrated in Apache Wicket 1.5.x #54 (See [http://hudson.zones.apache.org/hudson/job/Apache%20Wicket%201.5.x/54/])
    

> non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap
> ----------------------------------------------------------------------------------
>
>                 Key: WICKET-2741
>                 URL: https://issues.apache.org/jira/browse/WICKET-2741
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>            Reporter: Nikita Tovstoles
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.9, 1.5-M1
>
>         Attachments: wicket-2741.patch
>
>
> The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load. 
> * RequestListenerInterface.interfaces
> * WebApplication.addBufferedResponse
> * Injector.inject() - 'cache' field. 
> The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)
> Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:
> {noformat}
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |                                         Name                                         |    Time (ms)     |      Count      |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> |  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
> |  | |                                                                                 |                  |                 |
> |  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
> |  |                                                                                   |                  |                 |
> |  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
> |    |                                                                                 |                  |                 |
> |    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
> |      |                                                                               |                  |                 |
> |      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
> |        |                                                                             |                  |                 |
> |        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
> |        |                                                                             |                  |                 |
> |        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
> +--------------------------------------------------------------------------------------+------------------+-----------------+
> Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
> {noformat}

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