Re: [PHP-DEV] Switch Table Extension for PHP

2008-08-01 Thread Dmitry Stogov
Please note that the extension modifies op_array and run-time and it definitely will break opcode caches. However, it is probably possible to reimplement it on compiler level (may be with new opcode). Thanks. Dmitry. Marcus Boerger wrote: Hello Stefan, please discuss with RMs when to merge

Re: [PHP-DEV] Switch Table Extension for PHP

2008-08-01 Thread Stefan Esser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Dmitry, while I also believe that the extension should not be included in the core at the moment I strongly believe that it will be compatible with every well behaving opcode cache. Because it modifies op_array during execution... a) the

Re: [PHP-DEV] Switch Table Extension for PHP

2008-08-01 Thread Dmitry Stogov
Hi Stefan, Opcode caches don't usually copy the op_array.opcodes from shared memory to process memory, so modification of opcodes may affect other processes which execute the same op_array. As you set the extended_value in shared memory to point into process memory the other process will read it

Re: [PHP-DEV] Switch Table Extension for PHP

2008-08-01 Thread Stefan Esser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Dmitry, As you set the extended_value in shared memory to point into process memory the other process will read it and look into it's own memory, and of course it won't find proper switch-table there. In case the opcode cache directly uses

Re: [PHP-DEV] Switch Table Extension for PHP

2008-08-01 Thread Dmitry Stogov
The whole idea is great, but it'll work without problems only if switch-tables are constructed at compile (or optimization) time. The idea also won't work with variables and unresolved constants as case labels (I saw your extension already carries about this limitation). I think the proper way

Re: [PHP-DEV] Switch Table Extension for PHP

2008-08-01 Thread Stefan Esser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, The idea also won't work with variables and unresolved constants as case labels (I saw your extension already carries about this limitation). Yeah constants are the reason why I perform the optimization at runtime. Because the moment a switch

Re: [PHP-DEV] Switch Table Extension for PHP

2008-08-01 Thread Derick Rethans
On Fri, 1 Aug 2008, Dmitry Stogov wrote: The whole idea is great, but it'll work without problems only if switch-tables are constructed at compile (or optimization) time. The idea also won't work with variables and unresolved constants as case labels (I saw your extension already carries

Re: [PHP-DEV] Switch Table Extension for PHP

2008-08-01 Thread Igor Feghali
Hello Stefan, On 7/30/08, Stefan Esser [EMAIL PROTECTED] wrote: I am very interested how it performs with YOUR switch statements. And I am also very interested if its implementation unexpectedly breaks YOUR switch statements. this is potentially useful for the default parser of

Re: [PHP-DEV] Switch Table Extension for PHP

2008-07-31 Thread Marcus Boerger
Hello Stefan, please discuss with RMs when to merge this in. IMO such a nice locale improvment can go in anytime during alpha when RMs approve. marcus Wednesday, July 30, 2008, 10:18:02 PM, you wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, for everyone interested in getting

Re: [PHP-DEV] Switch Table Extension for PHP

2008-07-30 Thread Brian Moon
Stefan Esser wrote: http://www.suspekt.org/switchtable/ Neat I hope this works well and can go into the main engine. I did not look to see if there was a licensing issue. We have basically done this in PHP land for Phorum. We had a huge switch in our url creation function. It was the

Re: [PHP-DEV] Switch Table Extension for PHP

2008-07-30 Thread Sebastian Bergmann
Brian Moon schrieb: Neat I hope this works well and can go into the main engine. Should it not rather got into the new optimizer extension instead? -- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514