[Vm-dev] Re: Direct object pointers vs indirect ones pros and cons
siguctua at gmail.com
Wed Oct 26 20:43:12 UTC 2011
On 26 October 2011 23:11, Javier Burroni <javier.burroni at gmail.com> wrote:
> Igor Stasenko wrote:
>> the first bench is kind-of 'measure time to access directly to objects'
>> the second one is 'measure indirect access'
>> and third is measure a loop overhead.
> Hi there,
> I've just arrived to this thread (thanks to Mariano), and I wanted to share
> some speculations:
> Having JIT'ed code with self (the oop of the actual object) in a register,
> and selfID (the id of self in the object table) in a second register.
yes, but then i will ask you to compare results with JIT optimized for
direct pointers.. :)
> We have:
> accessing ivar: no extra cost
> method lookup:
> one extra indirection
> sends with MonomorphicInlineCache:
> no extra cost if implemented in an instance basis (checking against selfID).
hmm.. that doesn't makes inline cache to be effective.
usually many different objects are passing via single call site but
they having same class, this is where monomophic IC shines.
if you change the cache to work on per-instance basis, i think it will
make it less effective because of too much misses.
> One indirection otherwise
> GC (MarkAndCompact):
> Faster (due to the removal of the threading process).
yes, GC is faster because you don't need to rewrite pointers in each
object, with object table, when you moving object(s)
you only need to change the pointer in object table and you done.
> View this message in context: http://forum.world.st/Direct-object-pointers-vs-indirect-ones-pros-and-cons-tp3039203p3942123.html
> Sent from the Squeak VM mailing list archive at Nabble.com.
More information about the Vm-dev