Jochen Theodorou
2016-10-05 12:37:21 UTC
Hi all,
I am constructing a new meta class system for Groovy (ok, I say that for
several years already, but bear with me) and I was wondering about the
actual performance of switchpoints.
In my current scenario I would need a way to say a certain group of meta
classes got updated and the method for this callsite needs potentially
be reselected.
So if I have class A, class B and then I have a meta class for Object
and one for A.
If the meta class for A is changed, all handles operating on instances
of A may have to reselect. the handles for B and Object need not to be
affected. If the meta class for Object changes, I need to invalidate all
the handles for A, B and Object.
Doing this with switchpoints means probably one switchpoint per
metaclass and a small number of meta classes per class (in total 3 in my
example). This would mean my MethodHandle would have to get through a
bunch of switchpoints, before it can do the actual method invocation.
And while switchpoints might be fast it does not sound good to me.
Or I can do one switchpoint for all methodhandles in the system, which
makes me wonder if after a meta class change the callsite ever gets
Jitted again. The later performance penalty is actually also not very
attractive to me.
So what is the way to go here? Or is there an even better way?
bye Jochen
I am constructing a new meta class system for Groovy (ok, I say that for
several years already, but bear with me) and I was wondering about the
actual performance of switchpoints.
In my current scenario I would need a way to say a certain group of meta
classes got updated and the method for this callsite needs potentially
be reselected.
So if I have class A, class B and then I have a meta class for Object
and one for A.
If the meta class for A is changed, all handles operating on instances
of A may have to reselect. the handles for B and Object need not to be
affected. If the meta class for Object changes, I need to invalidate all
the handles for A, B and Object.
Doing this with switchpoints means probably one switchpoint per
metaclass and a small number of meta classes per class (in total 3 in my
example). This would mean my MethodHandle would have to get through a
bunch of switchpoints, before it can do the actual method invocation.
And while switchpoints might be fast it does not sound good to me.
Or I can do one switchpoint for all methodhandles in the system, which
makes me wonder if after a meta class change the callsite ever gets
Jitted again. The later performance penalty is actually also not very
attractive to me.
So what is the way to go here? Or is there an even better way?
bye Jochen