profiling go

Henry Cejtin henry@sourcelight.com
Mon, 11 Jun 2001 15:36:32 -0500


Avoiding the clearing of %edx is worth putting in, but I don't expect it will
buy a noticable improvement.  (It  is  still  worth  it  because  of  I-cache
considerations.)   I  think  that  leaving  the  allocation  and  use of real
registers to the local code generator is probably not worth  fixing  for  the
Intel  hardware.  Still, with regards to heuristics for spilling, my claim is
that the right one to use is that the value  most  desirable  to  keep  in  a
register  is  the one such taht there exists some control flow which accesses
it in the nearest future.  I.e., it isn't the average,  it  is  the  minimum.
The  argument is that if I have two flow paths, one 100 instructions long and
one 10 instructions long, then the cost of not keeping it in a  register  for
the  short path is way higher proportionately then for the longer.  Of course
it would be nice if known rare things (GC, exceptions) were not counted here.