A Crazy Thought about CallContext Recycling and Caching

chromatic chromatic at wgz.org
Mon Jan 4 21:23:59 UTC 2010


Most programs spend most of their time in a few function calls, and most of 
those function calls have static per-call arity and types.

Our CallContext system allows for the few cases where dynamism is necessary 
and fails to exploit the relative static nature of most calls in most 
programs.

We know:

1) the point of a call
2) (generally) the arity of the call

Can we create a cache (perhaps a PMC?) that allows us to skip recycling 
CallContext PMCs and their register storage locations into the PMC and fixed 
size pools, using the register size (or the pc of the call) as a key into the 
cache?

We'd have to detect when it's safe to recycle a CallContext, but we *could* 
hijack its destroy(), let the GC capture a few, and then store them in the 
cache by size and avoid subsequent GC runs.

(In a program where 70% of the GCables created are for PCC and where half of 
the program's time goes to GC, a 35% improvement seems likely.)

-- c


More information about the parrot-dev mailing list