Re: Traits and memory size

From: Date: Tue, 10 Apr 2012 07:42:47 +0000
Subject: Re: Traits and memory size
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi Ben:


On 10 Apr 2012, at 03:34, Ben Schmidt wrote:

> During the flattening process, is a copy made of the trait code (or
> bytecode or whatever)?


Thanks to Dmitry, the op_array, i.e., the methods op codes are not copied but shared between the
methods.

Thus, there is a certain memory benefit of sharing code in traits, compared to manual copy and past.

Best regards
Stefan


-- 
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax:   +32 2 629 3525



Thread (5 messages)

« previous php.internals (#59625) next »