Re: Docs for allocation sinking optimization

  • From: Geoff Leyland <geoff_leyland@xxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 18 Jul 2012 11:45:06 +1200

On 18/07/2012, at 11:31 AM, Mike Pall wrote:

> Geoff Leyland wrote:
>> Would it be interesting to ask "How many of the values
>> restored/replayed at trace exit are unused on-trace, and what
>> operation produced those values?".
> More interesting is whether the change would enable more
> allocations to be sunk or not. I'm not too worried about the
> simple add/sub operations themselves. E.g. (untested):
>  luajit -jdump=i script.lua | egrep -c "}.*(TNEW|TDUP|CNEW|CNEWI)"
> with/without the patch.

Right.  As I said, I'll keep at it bit by bit.

But my initial guess would be that it's not much use.  Beyond the general 
problem of not thinking enough about what I was doing, one of the reasons I was 
fooled that the patch worked is that it wasn't doing anything.  The SUBOV 
problem wasn't related to it being a subtraction - it was just the first piece 
of code (other than the very simple test case) I tested where it found 
something to do.  Most of the code I have just never triggers it.

If I get to the point that I'm confident that it works, and that it actually 
seems to do something, then I'll see if it saves allocations.

Other related posts: