<div dir="ltr"><div>I am not sure there is an easy way to consolidate these into a single map, since some of these are written to on reads, some on writes and sometimes conditionally written to.  And then as Dan said they are cleaned up at different times possibly.</div><div><br></div><div>We could do something like states (based on which ones would have written to the map), but I think it will get quite complex, especially if we ever add more of these map type requirement.</div><div><br></div><div>On a similar note, I had actually thought of possibly moving the expiration check out of the data container and into the entry wrapping interceptor or the likes.  This would allow for us to remove the expiration map completely since we could only raise the extra expiration commands on a read and not writes.  But this would change the API and I am thinking we can only do this for 9.0.</div><div><br></div><div class="gmail_quote"><div dir="ltr">On Mon, Nov 30, 2015 at 2:18 PM Dan Berindei &lt;<a href="mailto:dan.berindei@gmail.com" target="_blank">dan.berindei@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The first problem that comes to mind is that context entries are also<br>
stored in a map, at least in transactional mode. So access through the<br>
context would only be faster in non-tx caches, in tx caches it would<br>
not add any benefits.<br>
<br>
I also have some trouble imagining how these temporary entries would<br>
be released, since locks, L1 requestors, L1 synchronizers, and write<br>
registrations all have their own rules for cleaning up.<br>
<br>
Finally, I&#39;m not sure how much this would help. I actually removed the<br>
write registration for everything except RemoveExpiredCommand when<br>
testing the HotRod server performance, but I didn&#39;t get any<br>
significant improvement on my machine. Which was kind of expected,<br>
since the benchmark doesn&#39;t seem to be CPU-bound, and JFR was showing<br>
it with &lt; 1.5% of CPU.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers<br>
Dan<br>
<br>
<br>
On Fri, Nov 27, 2015 at 11:28 AM, Radim Vansa &lt;<a href="mailto:rvansa@redhat.com" target="_blank">rvansa@redhat.com</a>&gt; wrote:<br>
&gt; No thoughts at all? @wburns, could I have your view on this?<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; Radim<br>
&gt;<br>
&gt; On 11/23/2015 04:26 PM, Radim Vansa wrote:<br>
&gt;&gt; Hi again,<br>
&gt;&gt;<br>
&gt;&gt; examining some flamegraphs I&#39;ve found out that recently the<br>
&gt;&gt; ExpirationInterceptor has been added, which registers ongoing write in a<br>
&gt;&gt; hashmap. So at this point we have a map for locks, map for writes used<br>
&gt;&gt; for expiration, another two key-addressed maps in L1ManagerImpl and one<br>
&gt;&gt; in L1NonTxInterceptor and maybe another maps elsewhere.<br>
&gt;&gt;<br>
&gt;&gt; This makes me think that we could spare map lookups and expensive writes<br>
&gt;&gt; by providing *single map for temporary per-key data*. A reference to the<br>
&gt;&gt; entry could be stored in the context to save the lookups. An extreme<br>
&gt;&gt; case would be to put this into DataContainer, but I think that this<br>
&gt;&gt; would prove too tricky in practice.<br>
&gt;&gt;<br>
&gt;&gt; A downside would be the loss of encapsulation (any component could<br>
&gt;&gt; theoretically access e.g. locks), but I don&#39;t find that too dramatic.<br>
&gt;&gt;<br>
&gt;&gt; WDYT?<br>
&gt;&gt;<br>
&gt;&gt; Radim<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Radim Vansa &lt;<a href="mailto:rvansa@redhat.com" target="_blank">rvansa@redhat.com</a>&gt;<br>
&gt; JBoss Performance Team<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</blockquote></div></div>