Re: Re: Use zend_string* for op_array->arg_info[].name and class_name
| From: | Dmitry Stogov | Date: | Tue, 18 Nov 2014 09:40:25 +0000 |
| Subject: | Re: Re: Use zend_string* for op_array->arg_info[].name and class_name | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78936@lists.php.net to get a copy of this message | ||
Of course, it would be great to always use zend_string, but only arg_info
duplication (without char -> zend_string) would add ~90KB on 32-bit system
and ~150KB on 64-bit system per process. So I expect 300-500KB wasted per
process.
Actually, only inheritance and reflection code was complicated by the patch
(not significantly).
Thanks. Dmitry.
On Tue, Nov 18, 2014 at 8:47 AM, Stanislav Malyshev <smalyshev@gmail.com>
wrote:
> Hi!
>
> >> we only need do it in master process, and mark as interned(with hash
> >> precalculated), no write will be happened, so thanks to COW on fork, we
> >> won't need lots of extra memory.
> >>
> >
> > It's not true for Windows.
> > On Linux we would copy arg_info from shared read-only segment into
> process
> > heap memory, then some blocks may be COW or not depended on luck.
>
> How bad would it be? Given that significantly simplifies the code, and
> does not require to check and write two branches each time we deal with
> arginfo, maybe it is worth to spend some memory (given that we only
> spend it once on init)?
>