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

2011-05-21 Thread Martynas Venckus
On 5/21/11, Stas Malyshev wrote: > Hi! > >> What platform was that on? GCC already inlines its builtins by >> default (even at -O0). I.e., the abs() generates the following code: > > As I understand, Sebastian wasn't talking about inlining C abs(). He was > talking about converting PHP abs() (wh

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

2011-05-21 Thread Stas Malyshev
Hi! What platform was that on? GCC already inlines its builtins by default (even at -O0). I.e., the abs() generates the following code: As I understand, Sebastian wasn't talking about inlining C abs(). He was talking about converting PHP abs() (which is a function call right now with all o

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

2011-05-21 Thread Martynas Venckus
On 5/21/11, Sebastian Bergmann wrote: > 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 (rayt

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] [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] [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] 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.