Re: A simple PIC api

2015-03-11 Thread Mark Roos
Hi RĂ©mi, I assume you want me to be more specific about my concerns on: taking into account invalidation, multi core memory model and volatile state. My model is that I have a GWT chain, a cache, and a fallback which is updating the chain, and more than one core using the same callsit

Re: A simple PIC api

2015-03-11 Thread Mark Roos
Hi Jochen I have to think about yours some more but I thought I would share mine. I condensed it to make it easier to explain. regards mark I extended callsite to hold a bunch of values one of which is the depth. And my model for the cache is up to 10 chained GWTs after that I drop the chain

Re: A simple PIC api

2015-03-11 Thread Remi Forax
On 03/11/2015 11:12 PM, Mark Roos wrote: Remi commented I think you can adapt this code to implement what Mark want quite easily I don't disagree that pics are easy to code, my premise is that with a construct such I I proposed the jvm would do a better job of optimizing. Especially taking

Re: A simple PIC api

2015-03-11 Thread Remi Forax
On 03/11/2015 11:12 PM, Mark Roos wrote: From Jochen Do I also understand right, that your test for checking if the current target is still valid is limited to only the receiver? Well yes and no. In my case the test examines all of the arguments on the stack and computes an 'behavior' refere

Re: A simple PIC api

2015-03-11 Thread Mark Roos
Remi commented I think you can adapt this code to implement what Mark want quite easily I don't disagree that pics are easy to code, my premise is that with a construct such I I proposed the jvm would do a better job of optimizing. Especially taking into account invalidation, multi core memory

Re: A simple PIC api

2015-03-11 Thread Mark Roos
>From Jochen Do I also understand right, that your test for checking if the current target is still valid is limited to only the receiver? Well yes and no. In my case the test examines all of the arguments on the stack and computes an 'behavior' reference. This reference is the head of a link

Re: A simple PIC api

2015-03-11 Thread Mark Roos
Hi Jochen uses basically guardWithTest, so the order of the handles is never changed to for example trying the last one first or the one with the most hits recently. Is it not worth the trouble? In my case I always add the new gwt to the head of the chain. This fits my use case where the most

RE: A simple PIC api

2015-03-11 Thread Marrows, George A (GE Energy Management)
> so the order of the handles is never changed to for example trying the last > one first or the one with the most hits recently. Is it not worth the trouble? We found a useful gain at one point from reordering GWT chains so that the new MH was put on the end of the chain and the chain as a whol

Re: A simple PIC api

2015-03-11 Thread Jochen Theodorou
Am 11.03.2015 15:37, schrieb Remi Forax: [...] Sometime, yes, if you count the frequency of each branch by example, here is another code that implements a bimorphic inlining cache that expand to a dispatch table local to a callsite if necessary, I think you can adapt this code to implement what M

Re: A simple PIC api

2015-03-11 Thread Remi Forax
On 03/11/2015 03:00 PM, Jochen Theodorou wrote: Am 11.03.2015 14:46, schrieb Jochen Theodorou: [...] I really should write a PIC implementation for Groovy :( actually picking up on that maybe you guys could give some advice about how to structure a PIC internally. https://code.google.c

Re: A simple PIC api

2015-03-11 Thread Jochen Theodorou
Am 11.03.2015 14:46, schrieb Jochen Theodorou: [...] I really should write a PIC implementation for Groovy :( actually picking up on that maybe you guys could give some advice about how to structure a PIC internally. https://code.google.com/p/jsr292-cookbook/source/browse/trunk/inlining-

Re: A simple PIC api

2015-03-11 Thread Jochen Theodorou
Am 09.03.2015 18:51, schrieb Mark Roos: I was thinking about a generic pic, easy to use but flexible and came up with the following concept api. By passing the callsite and the testValue around with allowing an optional pic update I can envision this as a nice building block for several caching s

Re: A simple PIC api

2015-03-11 Thread Julien Ponge
The overhead is negligible in my micro-benchmarks for monomorphic and trimorphic call sites compared to regular Java virtual calls. - Julien On Tue, Mar 10, 2015, at 18:25, Mark Roos wrote: > From Julian > > That being said performance of the PIC construct is very good in our > case. > >