Hi all,
I want to raise a discussion on subject that is very important for PHP
usage on Embedded platforms.
I am myself working on projects where we use PHP to manage embedded
devices. Everything was fine but lately the need to work from flash
memory appeared.
We discovered that PHP binaries are linked statically with whole PHP
functionality and there is huge overhead when several SAPI modules used
on same system.
I have few question I hope to get answers on or ideas for:
-
Is there any reason to link all PHP SAPI modules statically with all
PHP objects? -
Is it possible to extract all shared functionality to shared object
and links all SAPI modules against it? -
Next issue is XML with DOM support, we where using LIBXML2 but that
costs ~2.5MB are there there options for supporting that?
Maybe someone already addressed footprint problem and has any kind of
solutions for that?
Please, any kind of information will helpful here.
Thanks ahead.
Eugene San
Hi all,
I want to raise a discussion on subject that is very important for PHP
usage on Embedded platforms.I am myself working on projects where we use PHP to manage embedded
devices. Everything was fine but lately the need to work from flash
memory appeared.
[snip!]Maybe someone already addressed footprint problem and has any kind of
solutions for that?Please, any kind of information will helpful here.
Eugene,
Not sure if this will help you, but this is something I came
across last night while working on a way to create a 100% mobile
server and website on my Windows Mobile Treo (purely for geek
purposes). I haven't had the chance to play with it, but if nothing
else, it may give you some ideas.
Pocket HPH:
http://mobileleap.net/hph/
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?
- Is there any reason to link all PHP SAPI modules statically with all
PHP objects?
In most cases you need only one SAPI, so there is no reason to share something.
- Is it possible to extract all shared functionality to shared object
and links all SAPI modules against it?
That's how it works on Win32.
And I have to mention that I've seen LOTS of bug reports from people who forget
to update php(4|5)ts.dll when upgrading PHP.
- Next issue is XML with DOM support, we where using LIBXML2 but that
costs ~2.5MB are there there options for supporting that?
What costs 2.5MB?
Dynamic linking against libxml2.so?
--
Wbr,
Antony Dovgal
Antony Dovgal wrote:
- Is there any reason to link all PHP SAPI modules statically with all
PHP objects?In most cases you need only one SAPI, so there is no reason to share something.
- Is it possible to extract all shared functionality to shared object
and links all SAPI modules against it?That's how it works on Win32.
And I have to mention that I've seen LOTS of bug reports from people who forget
to update php(4|5)ts.dll when upgrading PHP.
- Next issue is XML with DOM support, we where using LIBXML2 but that
costs ~2.5MB are there there options for supporting that?What costs 2.5MB?
Dynamic linking against libxml2.so?
Linking against libxml2 costs 0.4MB and libxml2 itself 2.1MB.
- Next issue is XML with DOM support, we where using LIBXML2 but that
costs ~2.5MB are there there options for supporting that?What costs 2.5MB?
Dynamic linking against libxml2.so?Linking against libxml2 costs 0.4MB and libxml2 itself 2.1MB.
Ok, so what are you proposing?
--
Wbr,
Antony Dovgal
Antony Dovgal wrote:
- Next issue is XML with DOM support, we where using LIBXML2 but that
costs ~2.5MB are there there options for supporting that?What costs 2.5MB?
Dynamic linking against libxml2.so?Linking against libxml2 costs 0.4MB and libxml2 itself 2.1MB.
Ok, so what are you proposing?
I was thinking of extracting shared objects among SAPI modules to
separate module and link against it.
Hi Eugene,
Do you want to have an option to exclude libxml2 and its related functionality from the build? If so, have you done the analysis of what pieces of PHP create this dependency?
In general, for the typical Web developer the tight integration of XML is a positive thing but if it's a minor tweak we may be able to look at that. You'd have to be more precise with this list though on what you really need and if you've managed to figure out the dependencies which prevent you from achieving your goals.
Andi
-----Original Message-----
From: Eugene San [mailto:eugenesan@gmail.com]
Sent: Tuesday, February 26, 2008 12:49 PM
To: PHP Developers Mailing List
Subject: [PHP-DEV] PHP footprint and sharing code among SAPI binariesHi all,
I want to raise a discussion on subject that is very important for PHP
usage on Embedded platforms.I am myself working on projects where we use PHP to manage embedded
devices. Everything was fine but lately the need to work from flash
memory appeared.We discovered that PHP binaries are linked statically with whole PHP
functionality and there is huge overhead when several SAPI modules used
on same system.I have few question I hope to get answers on or ideas for:
Is there any reason to link all PHP SAPI modules statically with all
PHP objects?Is it possible to extract all shared functionality to shared object
and links all SAPI modules against it?Next issue is XML with DOM support, we where using LIBXML2 but that
costs ~2.5MB are there there options for supporting that?Maybe someone already addressed footprint problem and has any kind of
solutions for that?Please, any kind of information will helpful here.
Thanks ahead.
Eugene San
Andi Gutmans wrote:
Hi Eugene,
Do you want to have an option to exclude libxml2 and its related functionality from the build? If so, have you done the analysis of what pieces of PHP create this dependency?
Currently I've replaced libxml2 with libexpat + DOM in php, that solution saved 400K in PHP.
I am pretty sure performance of DOM won't be same but that suits my needs.
I've experienced problems with finding correct parameters for configure, and finished with passing --disable-all and --enable-xxx for every feature i needed.
In general, for the typical Web developer the tight integration of XML is a positive thing but if it's a minor tweak we may be able to look at that. You'd have to be more precise with this list though on what you really need and if you've managed to figure out the dependencies which prevent you from achieving your goals.
Andi
-----Original Message-----
From: Eugene San [mailto:eugenesan@gmail.com]
Sent: Tuesday, February 26, 2008 12:49 PM
To: PHP Developers Mailing List
Subject: [PHP-DEV] PHP footprint and sharing code among SAPI binariesHi all,
I want to raise a discussion on subject that is very important for PHP
usage on Embedded platforms.I am myself working on projects where we use PHP to manage embedded
devices. Everything was fine but lately the need to work from flash
memory appeared.We discovered that PHP binaries are linked statically with whole PHP
functionality and there is huge overhead when several SAPI modules used
on same system.I have few question I hope to get answers on or ideas for:
Is there any reason to link all PHP SAPI modules statically with all
PHP objects?Is it possible to extract all shared functionality to shared object
and links all SAPI modules against it?Next issue is XML with DOM support, we where using LIBXML2 but that
costs ~2.5MB are there there options for supporting that?Maybe someone already addressed footprint problem and has any kind of
solutions for that?Please, any kind of information will helpful here.
Thanks ahead.
Eugene San