Frequency of stores into young objects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Frequency of stores into young objects

Clément Béra
 
Hi,

We changed recently with Eliot some part of the JIT to generate more efficient code for young objects mutation, speeding up a bit binary trees, especially when read-only objects are available. We did it only for quick inst var stores (popIntoInstanceVariable for inst var index between 0 and 7 on non context objects) as it was easier to narrow the optimization to this case and it is the most common case.

When starting-up a REPL image, there are 7221 mutations of objects through the quick inst var store bytecode, and 7082 are done on young objects. Hence, 98% of mutations for these bytecodes are done on young objects. 

Has anyone numbers from papers / large application on how many stores are done on young objects compared to stores done on old objects ? Does 98% sound reasonable ?

Regards,

Clement
Reply | Threaded
Open this post in threaded view
|

Re: Frequency of stores into young objects

timfelgentreff
 

No paper to cite from of the top of my head, but over 90% sounds reasonable to me. Does Squeak count as a large application? Looking at JIT traces from RSqueak/VM, most objects are completely omitted as they don't escape loops (e.g. some BitBlt loops with 1,000,000 operations have only half a dozen allocations and very few field stores - almost everything is just passed around over just a few methods and then dies)

cheers,
Tim


Am 25.07.2016 4:35 nachm. schrieb "Clément Bera" <[hidden email]>:
 
Hi,

We changed recently with Eliot some part of the JIT to generate more efficient code for young objects mutation, speeding up a bit binary trees, especially when read-only objects are available. We did it only for quick inst var stores (popIntoInstanceVariable for inst var index between 0 and 7 on non context objects) as it was easier to narrow the optimization to this case and it is the most common case.

When starting-up a REPL image, there are 7221 mutations of objects through the quick inst var store bytecode, and 7082 are done on young objects. Hence, 98% of mutations for these bytecodes are done on young objects. 

Has anyone numbers from papers / large application on how many stores are done on young objects compared to stores done on old objects ? Does 98% sound reasonable ?

Regards,

Clement


Reply | Threaded
Open this post in threaded view
|

Re: Frequency of stores into young objects

Levente Uzonyi
 
It highly depends on the style the code was written in. It's currently a
great optimization to avoid frequent allocations, and reuse the objects
instead, because GC costs a lot. So such code will keep changing old
objects all the time.

Levente
Reply | Threaded
Open this post in threaded view
|

Re: Frequency of stores into young objects

johnmci
 

98 percent die young  I ran some tests in squeak in the mid 2000 and saw the same 

Sent from my iPhone

On Jul 25, 2016, at 11:30 AM, Levente Uzonyi <[hidden email]> wrote:

It highly depends on the style the code was written in. It's currently a great optimization to avoid frequent allocations, and reuse the objects instead, because GC costs a lot. So such code will keep changing old objects all the time.

Levente

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Frequency of stores into young objects

melkyades
In reply to this post by Clément Béra
 
The garbage collection handbook has many references to statistics of pointers in the heap. In particular, Gen GC chapter - Pointer Direction (p125) says:

"[...] Many pointer writes are initialising stores to newly created objects - Zorn[1990] estimated that 90% to 95% of lisp pointer stores were initialising (and that of the remaining non-initialising stores two-thirds were to objects in the young generation) [...]"

so (if this also applies to Smalltalk) ~98% makes sense (90%+6,666%)

I guess the cited paper is this one:


cheers,
pocho



On Mon, Jul 25, 2016 at 11:35 AM, Clément Bera <[hidden email]> wrote:
 
Hi,

We changed recently with Eliot some part of the JIT to generate more efficient code for young objects mutation, speeding up a bit binary trees, especially when read-only objects are available. We did it only for quick inst var stores (popIntoInstanceVariable for inst var index between 0 and 7 on non context objects) as it was easier to narrow the optimization to this case and it is the most common case.

When starting-up a REPL image, there are 7221 mutations of objects through the quick inst var store bytecode, and 7082 are done on young objects. Hence, 98% of mutations for these bytecodes are done on young objects. 

Has anyone numbers from papers / large application on how many stores are done on young objects compared to stores done on old objects ? Does 98% sound reasonable ?

Regards,

Clement




--
Javier Pimás
Ciudad de Buenos Aires