[JBoss JIRA] (ISPN-6003) Reduce number of allocations
by William Burns (JIRA)
[ https://issues.jboss.org/browse/ISPN-6003?page=com.atlassian.jira.plugin.... ]
William Burns updated ISPN-6003:
--------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
> Reduce number of allocations
> ----------------------------
>
> Key: ISPN-6003
> URL: https://issues.jboss.org/browse/ISPN-6003
> Project: Infinispan
> Issue Type: Task
> Components: Core, Server
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Labels: performance
> Fix For: 8.1.0.Final
>
>
> Profiling revealed some allocations that are easy to remove:
> * The HotRod operations factory stores a list of flags in a thread-local. The thread-local can be removed, and the flags can be stored in an {{int}}.
> * JGroupsTransport copies the list of members to check if a broadcast should be sent as a unicast, and the copy is then discarded.
> * ExtendedByteBuf could use {{Array.empty}} instead of {{Array[Byte]()}}.
> * DecoratedCache could avoid calling {{Arrays.asList()}}.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (ISPN-6009) Stop using thread-locals for marshalling
by Dan Berindei (JIRA)
Dan Berindei created ISPN-6009:
----------------------------------
Summary: Stop using thread-locals for marshalling
Key: ISPN-6009
URL: https://issues.jboss.org/browse/ISPN-6009
Project: Infinispan
Issue Type: Task
Components: Core, Marshalling
Affects Versions: 8.0.2.Final
Reporter: Dan Berindei
Assignee: Dan Berindei
Marshalling currently uses a thread-local cache for {{RiverMarshaller}} instances. One of the reasons to cache these {{RiverMarshaller}}s was that they always allocate 2 {{IdentityIntMap}}s, one for the instance cache and one for the class cache.
But that also creates a problem, because these caches never shrink. If a {{StateResponseCommand}} includes a lot of {{Serializable}} objects, the caches will grow, and then they will never be used untile the next state transfer.
We should change our internal marshalling API so that it's easy to reuse marshallers without using thread-locals, and to use one-off marshallers for state transfer.
Currently unmarshalling also requires a thread-local to use the proper classloader. A session-based marshalling API would remove the need for the thread-local (especially important with sequential interceptors).
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (ISPN-5803) Custom Key Results in ClassCastException in CacheLoader
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-5803?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño commented on ISPN-5803:
----------------------------------------
The two PRs sent so far have not satisfactory in obtaining a solution to this problem. We will revisit this for 8.2 where we will provide overloaded methods for when Keys that are wrapped in a MarshalledValue are provided. By doing so, the rest of methods can really trully expect a K type.
> Custom Key Results in ClassCastException in CacheLoader
> -------------------------------------------------------
>
> Key: ISPN-5803
> URL: https://issues.jboss.org/browse/ISPN-5803
> Project: Infinispan
> Issue Type: Bug
> Components: JCache
> Affects Versions: 8.0.1.Final
> Reporter: Dan Siviter
> Assignee: Galder Zamarreño
> Fix For: 8.2.0.Final
>
>
> If a a JCache is created using a read-through {{javax.cache.integration.CacheLoader}} using a custom Serializable key (in this case {{acme.MyCache$MyKey}}) a {{ClassCastException}} is thrown when trying to pass the key value of {{org.infinispan.marshall.core.MarshalledValue}} instead of {{MarshalledValue#get()}} into the {{CacheLoader}} instance.
> {code}
> java.lang.ClassCastException: org.infinispan.marshall.core.MarshalledValue cannot be cast to acme.MyCache$MyKey
> at acme.MyCache$2.load(MyCache.java:1) [my-app-1.0.0-SNAPSHOT.jar:]
> at org.infinispan.jcache.embedded.JCacheLoaderAdapter.loadKey(JCacheLoaderAdapter.java:65) [infinispan-jcache-8.0.1.Final.jar:8.0.1.Final]
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (ISPN-5803) Custom Key Results in ClassCastException in CacheLoader
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-5803?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño updated ISPN-5803:
-----------------------------------
Fix Version/s: 8.2.0.Final
(was: 8.1.0.Final)
> Custom Key Results in ClassCastException in CacheLoader
> -------------------------------------------------------
>
> Key: ISPN-5803
> URL: https://issues.jboss.org/browse/ISPN-5803
> Project: Infinispan
> Issue Type: Bug
> Components: JCache
> Affects Versions: 8.0.1.Final
> Reporter: Dan Siviter
> Assignee: Galder Zamarreño
> Fix For: 8.2.0.Final
>
>
> If a a JCache is created using a read-through {{javax.cache.integration.CacheLoader}} using a custom Serializable key (in this case {{acme.MyCache$MyKey}}) a {{ClassCastException}} is thrown when trying to pass the key value of {{org.infinispan.marshall.core.MarshalledValue}} instead of {{MarshalledValue#get()}} into the {{CacheLoader}} instance.
> {code}
> java.lang.ClassCastException: org.infinispan.marshall.core.MarshalledValue cannot be cast to acme.MyCache$MyKey
> at acme.MyCache$2.load(MyCache.java:1) [my-app-1.0.0-SNAPSHOT.jar:]
> at org.infinispan.jcache.embedded.JCacheLoaderAdapter.loadKey(JCacheLoaderAdapter.java:65) [infinispan-jcache-8.0.1.Final.jar:8.0.1.Final]
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (ISPN-5803) Custom Key Results in ClassCastException in CacheLoader
by Galder Zamarreño (JIRA)
[ https://issues.jboss.org/browse/ISPN-5803?page=com.atlassian.jira.plugin.... ]
Galder Zamarreño updated ISPN-5803:
-----------------------------------
Status: Open (was: Pull Request Sent)
> Custom Key Results in ClassCastException in CacheLoader
> -------------------------------------------------------
>
> Key: ISPN-5803
> URL: https://issues.jboss.org/browse/ISPN-5803
> Project: Infinispan
> Issue Type: Bug
> Components: JCache
> Affects Versions: 8.0.1.Final
> Reporter: Dan Siviter
> Assignee: Galder Zamarreño
> Fix For: 8.2.0.Final
>
>
> If a a JCache is created using a read-through {{javax.cache.integration.CacheLoader}} using a custom Serializable key (in this case {{acme.MyCache$MyKey}}) a {{ClassCastException}} is thrown when trying to pass the key value of {{org.infinispan.marshall.core.MarshalledValue}} instead of {{MarshalledValue#get()}} into the {{CacheLoader}} instance.
> {code}
> java.lang.ClassCastException: org.infinispan.marshall.core.MarshalledValue cannot be cast to acme.MyCache$MyKey
> at acme.MyCache$2.load(MyCache.java:1) [my-app-1.0.0-SNAPSHOT.jar:]
> at org.infinispan.jcache.embedded.JCacheLoaderAdapter.loadKey(JCacheLoaderAdapter.java:65) [infinispan-jcache-8.0.1.Final.jar:8.0.1.Final]
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (ISPN-6003) Reduce number of allocations
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-6003?page=com.atlassian.jira.plugin.... ]
Dan Berindei updated ISPN-6003:
-------------------------------
Status: Open (was: New)
> Reduce number of allocations
> ----------------------------
>
> Key: ISPN-6003
> URL: https://issues.jboss.org/browse/ISPN-6003
> Project: Infinispan
> Issue Type: Task
> Components: Core, Server
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Labels: performance
> Fix For: 8.1.0.Final
>
>
> Profiling revealed some allocations that are easy to remove:
> * The HotRod operations factory stores a list of flags in a thread-local. The thread-local can be removed, and the flags can be stored in an {{int}}.
> * JGroupsTransport copies the list of members to check if a broadcast should be sent as a unicast, and the copy is then discarded.
> * ExtendedByteBuf could use {{Array.empty}} instead of {{Array[Byte]()}}.
> * DecoratedCache could avoid calling {{Arrays.asList()}}.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months