Re: cvs: php-src(PHP_5_2) /ext/bz2 bz2.c php_bz2.h /ext/ctype ctype.c php_ctype.h /ext/json json.c php_json.h /ext/pspell php_pspell.h pspell.c
/ext/tidy php_tidy.h tidy.c /ext/zlib php_zlib.h zlib.c zlib_fopen_wrapper.c
| From: | Nuno Lopes | Date: | Thu, 31 Aug 2006 19:24:05 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_2) /ext/bz2 bz2.c php_bz2.h /ext/ctype ctype.c php_ctype.h /ext/json json.c php_json.h /ext/pspell php_pspell.h pspell.c /ext/tidy php_tidy.h tidy.c /ext/zlib php_zlib.h zlib.c zlib_fopen_wrapper.c |
||
| References: | 1 2 3 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-40259@lists.php.net to get a copy of this message | ||
Hello,
Sorry for the late answer, but I was on vacations and without internet access.
Thanks for the support Marcus. Marking functions as static also reduces code size. When building PHP with -fPIC the decrease in size is really noticeable. constifying allows the OS to share memory pages between proccesses, reducing the overall memory usage.
btw, I have a couple of patches (that play with the compilers) waiting for someone from the Zend Engine team to review. Can someone please take a look at them?
For example, http://mega.ist.utl.pt/~ncpl/php_gcc4_visibility.txt reduces the dso size when used with gcc 4.
I also like this one: http://mega.ist.utl.pt/~ncpl/zend_arginfo_const.txt
plus the huge one: http://mega.ist.utl.pt/~ncpl/Zend_2nd_constify_patch.txt
Nuno
P.S.: I would like to keep messing with compiler options, as compilers are one of my passions :)
----- Original Message -----
Hello Andi, one thing it helps in is that having it as non static makes some compilers use an additional jump. Actually for shared dlls those functions might end up in the jump table that is going to be initialized during loading process. So infact there might be some advantage in doing it this way. Also constifying is one of our overall goals since long. And here we finally have someone willing to do the job, why not letting him do it? best regards marcus Saturday, August 26, 2006, 1:19:01 PM, you wrote:I don't think it helps. It won't inline these functions in most cases anyway, and having or not having a symbol shouldn't make a difference. I'd prefer to stick to our standards and keep all extensions the same. Who knows if/when we'll want to play around with the symbols also. It could come in handly with dlls.AndiWhy is this important? We never defined these as static. As long as you move them to the .c file (for whatever reason you have-----Original Message----- From: Ilia Alshanetsky [mailto:iliaal@gmail.com] On Behalf Of Ilia Alshanetsky Sent: Saturday, August 26, 2006 9:59 AM To: Andi Gutmans Cc: 'Nuno Lopes'; php-cvs@lists.php.net Subject: Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/bz2 bz2.c php_bz2.h /ext/ctype ctype.c php_ctype.h /ext/json json.c php_json.h /ext/pspell php_pspell.h pspell.c /ext/tidy php_tidy.h tidy.c /ext/zlib php_zlib.h zlib.c zlib_fopen_wrapper.c Andi, I think the idea here was to minimize memory utilization and allow the compiler to optimize the code better, something that having functions defined as statics appears to help with. On 26-Aug-06, at 11:30 AM, Andi Gutmans wrote:be justified) you really don't have to define them as static IMO.that mightBest regards, MarcusIlia Alshanetsky