Re: [PHP-DEV] Traits and memory size

2012-04-10 Thread Ben Schmidt
During the flattening process, is a copy made of the trait code (or bytecode or whatever)? ... Or is the code shared so the memory use will be roughly the same? ... I realise the use cases for traits and inheritance are different, and often the situation will dictate the design, but sometimes

Re: [PHP-DEV] Traits and memory size

2012-04-10 Thread Ben Schmidt
On 10/04/12 5:42 PM, Stefan Marr wrote: 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. Th

Re: [PHP-DEV] Traits and memory size

2012-04-10 Thread Stefan Marr
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 benefi

RE: [PHP-DEV] Traits and memory size

2012-04-09 Thread Jared Williams
> -Original Message- > From: Ben Schmidt [mailto:mail_ben_schm...@yahoo.com.au] > Sent: 10 April 2012 02:35 > To: internals@lists.php.net > Subject: [PHP-DEV] Traits and memory size > > Hi! > > Just a quick question about traits. > > During the flattening process, is a copy made of t