Re: [PHP-DEV] [PATCH] arithmetic speedup

2011-05-20 Thread Sebastian Bergmann
On 05/20/2011 11:28 AM, Dmitry Stogov wrote: The bench.php gets more than 10% speedup (2.5 sec instead of 2.9 sec) Real-life applications are not affected. All the PHPT tests are passed. I chatted with Kore Nordmann, the creator of Image_3D (raytracer written in PHP) and ezcGraph (chart compo

Re: [PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Pierre Joye
On Fri, May 20, 2011 at 11:16 PM, Hannes Magnusson wrote: > 2011/5/20 Brian Moon : >>> I think it's the exact opposite - the less C code we need the better. >>> Developing C code is more work. Maintaining C code is more work. >>> Distributing C code is more complicated. The less this is needed, th

Re: [PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Hannes Magnusson
2011/5/20 Brian Moon : >> I think it's the exact opposite - the less C code we need the better. >> Developing C code is more work. Maintaining C code is more work. >> Distributing C code is more complicated. The less this is needed, the >> faster PHP is, the better for everybody (except C programme

Re: [PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Larry Garfield
On 05/20/2011 12:01 PM, Johannes Schlüter wrote: On Fri, 2011-05-20 at 11:45 -0500, Larry Garfield wrote: If the long term result is that PECL gets more attention and usage as people realize the advantages of C-based code, even better. I think it's the exact opposite - the less C code we need t

Re: [PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Brian Moon
I think it's the exact opposite - the less C code we need the better. Developing C code is more work. Maintaining C code is more work. Distributing C code is more complicated. The less this is needed, the faster PHP is, the better for everybody (except C programmers ;-) ) I was with you until "T

Re: [PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Andrew Curioso
AMF-PHP does something similar to this. It is a PHP implementation of AMF (Action Message Format) so it allows you to accept and respond to AMF messages from Flash apps. Its native PHP encoder is extremely slow but it works. However, if you install amfext from PECL it will use that for encoding in

Re: [PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Johannes Schlüter
On Fri, 2011-05-20 at 11:45 -0500, Larry Garfield wrote: > If the long term result is that PECL gets more attention and usage as > people realize the advantages of C-based code, even better. I think it's the exact opposite - the less C code we need the better. Developing C code is more work. Main

Re: [PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Larry Garfield
On 05/20/2011 11:33 AM, Johannes Schlüter wrote: We had the thought of partially automating the process by having PHP auto-generate at the very least the subs of any classes and functions that the module provides. However, when my colleague tried using the same parser as is used for generatin

Re: [PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Richard Quadling
On 20 May 2011 17:15, Larry Garfield wrote: > Hi all. > > I'm working with a fellow developer on an experimental project.  There are > some PECL modules that we want to try and use in an open source project > where we cannot guarantee that PECL modules will be available, since it's > intended for

Re: [PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Johannes Schlüter
Hi, On Fri, 2011-05-20 at 11:15 -0500, Larry Garfield wrote: > 1) Is this even a viable approach? It seems like it, but to my > knowledge no one else has done this to any serious extent which makes me > wonder if there's a reason the road less traveled is less traveled. This is a case by case

[PHP-DEV] Porting PECL to userspace

2011-05-20 Thread Larry Garfield
Hi all. I'm working with a fellow developer on an experimental project. There are some PECL modules that we want to try and use in an open source project where we cannot guarantee that PECL modules will be available, since it's intended for widespread distribution on both shared hosts and cu

Re: [PHP-DEV] [PATCH] arithmetic speedup

2011-05-20 Thread jvlad
"Dmitry Stogov" wrote in message news:4dd63c03.3090...@zend.com... > The main idea of the patch is inlining and I don't know how can I inline > from external file. via #include and macros, as many others do. see longlong.h in GNU libgcrypt-1.4.6/libgcrypt-1.4.6/mpi/ just my 2c -- PHP In

Re: [PHP-DEV] Need karma for committing test patches

2011-05-20 Thread Alexey Shein
So what do you think should be done here? Check closed streams and reset them to default as in my first try? -- Regards, Shein Alexey -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Need karma for committing test patches

2011-05-20 Thread Gustavo Lopes
Em Fri, 20 May 2011 12:14:07 +0100, Pierre Joye escreveu: On Fri, May 20, 2011 at 1:12 PM, Gustavo Lopes wrote: Now, I'm starting to think something in the line of your original patch is better. Of course, curl_multi_exec and the other options would have to be considered too. Yes, t

Re: [PHP-DEV] Need karma for committing test patches

2011-05-20 Thread Pierre Joye
On Fri, May 20, 2011 at 1:12 PM, Gustavo Lopes wrote: > Now, I'm starting to think something in the line of your original patch is > better. Of course, curl_multi_exec and the other options would have to be > considered too. Yes, that's what I told Alexy on IRC as well. Especially as I don't see

Re: [PHP-DEV] Need karma for committing test patches

2011-05-20 Thread Gustavo Lopes
Em Fri, 20 May 2011 07:59:51 +0100, Alexey Shein escreveu: * I think a better strategy would be to just dup the file descriptor gotten after the cast in curl_setopt, store it (instead of storing the zval) and close it on curl handle destruction. This way we wouldn't have to worry about z

Re: [PHP-DEV] [PATCH] arithmetic speedup

2011-05-20 Thread Pierre Joye
On Fri, May 20, 2011 at 12:40 PM, Dmitry Stogov wrote: > On 05/20/2011 02:05 PM, Pierre Joye wrote: >> >> On Fri, May 20, 2011 at 12:01 PM, Dmitry Stogov  wrote: >>> >>> Hi Pierre, >>> >>> On 05/20/2011 01:49 PM, Pierre Joye wrote: hi Dmitry, Nice improvements, thanks :) >

Re: [PHP-DEV] [PATCH] arithmetic speedup

2011-05-20 Thread Dmitry Stogov
On 05/20/2011 02:05 PM, Pierre Joye wrote: On Fri, May 20, 2011 at 12:01 PM, Dmitry Stogov wrote: Hi Pierre, On 05/20/2011 01:49 PM, Pierre Joye wrote: hi Dmitry, Nice improvements, thanks :) Any reason not to have done the changes for windows as well? Sorry, I'm not an expert in MS VC i

Re: [PHP-DEV] [PATCH] pg_escape_literal/pg_escape_identifier for pgsql

2011-05-20 Thread Hannes Magnusson
On Fri, May 20, 2011 at 03:24, Yasuo Ohgaki wrote: > Hi all > > Current PostgreSQL has new escape functions for literals and identifiers. > Since there is no function for that, I made patch for that. Attached patch is > for trunk and tested with PostgreSQL 8.4 and 9.0. > > This patch would also ap

Re: [PHP-DEV] [PATCH] arithmetic speedup

2011-05-20 Thread Pierre Joye
On Fri, May 20, 2011 at 12:01 PM, Dmitry Stogov wrote: > Hi Pierre, > > On 05/20/2011 01:49 PM, Pierre Joye wrote: >> >> hi Dmitry, >> >> Nice improvements, thanks :) >> >> Any reason not to have done the changes for windows as well? > > Sorry, I'm not an expert in MS VC inline assembler. > As I r

Re: [PHP-DEV] [PATCH] arithmetic speedup

2011-05-20 Thread Dmitry Stogov
Hi Pierre, On 05/20/2011 01:49 PM, Pierre Joye wrote: hi Dmitry, Nice improvements, thanks :) Any reason not to have done the changes for windows as well? Sorry, I'm not an expert in MS VC inline assembler. As I remember in VC6 it was poor and didn't allow complicated things. In case someone

Re: [PHP-DEV] [PATCH] arithmetic speedup

2011-05-20 Thread Pierre Joye
hi Dmitry, Nice improvements, thanks :) Any reason not to have done the changes for windows as well? What's about putting the asm code in external file so it can used by more compilers? (some has issues with inline asm, like VC in x64 mode, other may have as well afair). Cheers, On Fri, May 20

[PHP-DEV] [PATCH] arithmetic speedup

2011-05-20 Thread Dmitry Stogov
Hi, The attached patch improves speed of numeric operations by inlining the most probable paths directy into executor. It also optimizes some operations for x86 CPU using assembler. The bench.php gets more than 10% speedup (2.5 sec instead of 2.9 sec) Real-life applications are not affected.

Re: [PHP-DEV] Need karma for committing test patches

2011-05-20 Thread Alexey Shein
>> * I think a better strategy would be to just dup the file descriptor gotten >> after the cast in curl_setopt, store it (instead of storing the zval) and >> close it on curl handle destruction. This way we wouldn't have to worry >> about zval refcounts or whether the file descriptor obtained is s