develooper Front page | perl.perl6.internals | Postings from December 2001

[COMMIT] Predereferencing gets a boost

Gregor N. Purdy
December 18, 2001 12:13
[COMMIT] Predereferencing gets a boost
Message ID:
All --

I just committed some performance-enhancing changes to the
predereferencing code path. The commit message follows after
some notes on the performance results here.

Without optimization:

  Before the change:

    ./test_parrot    examples/assembly/mops.pbc --> 23.02
    ./test_parrot -P examples/assembly/mops.pbc --> 29.96 [+30.0%]

  After the change:

    ./test_parrot    examples/assembly/mops.pbc --> 24.02 [+ 4.3%]
    ./test_parrot -P examples/assembly/mops.pbc --> 32.40 [+40.7%]

With optimization (gcc -O9):

  Before the change:

    ./test_parrot    examples/assembly/mops.pbc --> 43.53
    ./test_parrot -P examples/assembly/mops.pbc --> 45.67 [+ 4.9%]

  After the change:

    ./test_parrot    examples/assembly/mops.pbc --> 43.53 [+ 0.0%]
    ./test_parrot -P examples/assembly/mops.pbc --> 48.87 [+12.3%]


Performance improvements to the predereferencing code path 
suggested to me over lunch yesterday by my friend John Kennedy.
The goal is to remove the additional test in the inner loop
that was checking for NULL to decide whether or not to call
the prederef() function. Also moved pc & pc_prederef syncing
outside the innner loop.

  * Changed the prototype of the prederef() function in
    interpreter.c to match that of an opfunc.

  * Instead of initializing the prederef void * array with NULL,
    we initialize it with pointers to prederef().

  * prederef() now returns the prederef_pc passed in, so that
    after predereferencing, the same location is executed, but now
    with the real code being called.

Thanks to: John Kennedy


-- Gregor
/            Inspiration >> Innovation >> Excellence (TM)            \

   Gregor N. Purdy               
   Focus Research, Inc.     
   8080 Beckett Center Drive #203                  513-860-3570 vox
   West Chester, OH 45069                          513-860-3579 fax

[]$ ping
PING ( from : 56 bytes of data.
From Time to live exceeded Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About