Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-04 Thread Dmitry Stogov
On Wed, Mar 4, 2015 at 11:21 AM, Joe Watkins wrote: > Just-In-Time-At-Once JITAO > file at once, function at once, trace at once, basic block at once - just different JIT approaches. The bigger part we analyze at once the more information we may get for optimization, but the slower compilation.

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-04 Thread Joe Watkins
Just-In-Time-At-Once JITAO It is a bit different to the thing we think of as JIT ... new names are good if old names don't fit ... Cheers Joe On Wed, Mar 4, 2015 at 8:03 AM, Xinchen Hui wrote: > On Wed, Mar 4, 2015 at 3:44 PM, Dmitry Stogov wrote: > > On Tue, Mar 3, 2015 at 10:55 PM, Anthony

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-04 Thread Xinchen Hui
On Wed, Mar 4, 2015 at 3:44 PM, Dmitry Stogov wrote: > On Tue, Mar 3, 2015 at 10:55 PM, Anthony Ferrara > wrote: > >> Dmitry, >> >> >> So, let's put that to the test, shall we. I compiled and ran the "JIT" >> >> compiler (can we please stop calling it that, it's not). >> > >> > >> > This is JIT!

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Dmitry Stogov
On Tue, Mar 3, 2015 at 10:55 PM, Anthony Ferrara wrote: > Dmitry, > > >> So, let's put that to the test, shall we. I compiled and ran the "JIT" > >> compiler (can we please stop calling it that, it's not). > > > > > > This is JIT! > > My apologies. I interpreted your reply to an earlier email tha

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Anthony Ferrara
Dmitry, >> So, let's put that to the test, shall we. I compiled and ran the "JIT" >> compiler (can we please stop calling it that, it's not). > > > This is JIT! My apologies. I interpreted your reply to an earlier email that you were doing all of the code generation at compile time, not at runtim

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Zeev Suraski
>> > To: Zeev Suraski >> > Cc: PHP Internals >> > Subject: Re: [PHP-DEV] Re: Zend JIT Open Sourced >> > >> > Now, to the point that "gcc uses output buffering". >> >> Not gcc, glibc's stdout. > > CLI uses unbuffered write() sy

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Zeev Suraski
> On 3 במרץ 2015, at 19:08, Anthony Ferrara wrote: > > Zeev, > > On Tue, Mar 3, 2015 at 11:32 AM, Zeev Suraski wrote: >>> It wins on uneven ground. >> >> Without the output buffering code it's a LOT more uneven, as the PHP version >> is flushing every byte - approx. 6,000 such flushes. > > T

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Anthony Ferrara
Zeev, On Tue, Mar 3, 2015 at 11:32 AM, Zeev Suraski wrote: >> It wins on uneven ground. > > Without the output buffering code it's a LOT more uneven, as the PHP version > is flushing every byte - approx. 6,000 such flushes. Then the benchmark should suffer because of that. You're testing the ful

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Dmitry Stogov
On Tue, Mar 3, 2015 at 6:57 PM, Zeev Suraski wrote: > > -Original Message- > > From: Anthony Ferrara [mailto:ircmax...@gmail.com] > > Sent: Tuesday, March 03, 2015 5:44 PM > > To: Zeev Suraski > > Cc: PHP Internals > > Subject: Re: [PHP-DEV] Re

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Dmitry Stogov
On Tue, Mar 3, 2015 at 6:44 PM, Anthony Ferrara wrote: > Zeev, > > On Tue, Mar 3, 2015 at 8:05 AM, Zeev Suraski wrote: > >> So I do apologize to the person. I don't to the code. > > > > I wanted to verify whether my gut was correct (minimal amount of output, > and > > stdout is in fact buffered

RE: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Zeev Suraski
> It wins on uneven ground. Without the output buffering code it's a LOT more uneven, as the PHP version is flushing every byte - approx. 6,000 such flushes. > Which was the very initial point that I > made. One writes to interactive output within the loop (even if > buffered, it's flushed 69 tim

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Anthony Ferrara
Zeev, On Tue, Mar 3, 2015 at 10:57 AM, Zeev Suraski wrote: >> -Original Message- >> From: Anthony Ferrara [mailto:ircmax...@gmail.com] >> Sent: Tuesday, March 03, 2015 5:44 PM >> To: Zeev Suraski >> Cc: PHP Internals >> Subject: Re: [PHP-DEV]

RE: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Zeev Suraski
> -Original Message- > From: Anthony Ferrara [mailto:ircmax...@gmail.com] > Sent: Tuesday, March 03, 2015 5:44 PM > To: Zeev Suraski > Cc: PHP Internals > Subject: Re: [PHP-DEV] Re: Zend JIT Open Sourced > > Zeev, > > On Tue, Mar 3, 2015 at 8:05 AM, Zee

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Anthony Ferrara
Zeev, On Tue, Mar 3, 2015 at 8:05 AM, Zeev Suraski wrote: >> So I do apologize to the person. I don't to the code. > > I wanted to verify whether my gut was correct (minimal amount of output, and > stdout is in fact buffered - output shouldn't move the needle) and asked > Dmitry to rerun the C te

RE: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Zeev Suraski
> -Original Message- > From: julienpa...@gmail.com [mailto:julienpa...@gmail.com] On Behalf Of > Julien Pauli > Sent: Tuesday, March 03, 2015 5:11 PM > To: Zeev Suraski > Cc: Anthony Ferrara; PHP Internals > Subject: Re: [PHP-DEV] Re: Zend JIT Open Sourced > >

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Julien Pauli
On Tue, Mar 3, 2015 at 2:05 PM, Zeev Suraski wrote: > > So I do apologize to the person. I don't to the code. > > I wanted to verify whether my gut was correct (minimal amount of output, > and > stdout is in fact buffered - output shouldn't move the needle) and asked > Dmitry to rerun the C test

RE: [PHP-DEV] Re: Zend JIT Open Sourced

2015-03-03 Thread Zeev Suraski
> So I do apologize to the person. I don't to the code. I wanted to verify whether my gut was correct (minimal amount of output, and stdout is in fact buffered - output shouldn't move the needle) and asked Dmitry to rerun the C test on the same system, but this time with the output code completely

[PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Xinchen Hui
Hey: On Fri, Feb 27, 2015 at 8:10 PM, Dmitry Stogov wrote: > Hi, > > With the recent discussions of JIT/AOT and the good progress we made on > PHP-7, we decided to open up the JIT experiment we've been working on. > > https://github.com/zendtech/php-src/tree/zend-jit/ext/opcache/jit > > You may

RE: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Zeev Suraski
> -Original Message- > From: Anthony Ferrara [mailto:ircmax...@gmail.com] > Sent: Friday, February 27, 2015 10:54 PM > To: Zeev Suraski > Cc: Dmitry Stogov; PHP Internals > Subject: Re: [PHP-DEV] Re: Zend JIT Open Sourced > > Zeev, > > On Fri, Feb 27, 2015 a

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Dmitry Stogov
> >> To: Dmitry Stogov > >> Cc: Zeev Suraski; Jordi Boggiano; PHP Internals > >> Subject: Re: [PHP-DEV] Re: Zend JIT Open Sourced > >> > >> Dmitry, > >> > >> > Sneaky sneaky. Also completely fake. > >> > >> It's

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Anthony Ferrara
Zeev, On Fri, Feb 27, 2015 at 3:36 PM, Zeev Suraski wrote: >> -Original Message- >> From: Anthony Ferrara [mailto:ircmax...@gmail.com] >> Sent: Friday, February 27, 2015 10:21 PM >> To: Dmitry Stogov >> Cc: Zeev Suraski; Jordi Boggiano; PHP Internals >

RE: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Zeev Suraski
> -Original Message- > From: Anthony Ferrara [mailto:ircmax...@gmail.com] > Sent: Friday, February 27, 2015 9:36 PM > To: Dmitry Stogov > Cc: Zeev Suraski; Jordi Boggiano; PHP Internals > Subject: Re: [PHP-DEV] Re: Zend JIT Open Sourced > > And looking at the code

RE: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Zeev Suraski
> -Original Message- > From: Anthony Ferrara [mailto:ircmax...@gmail.com] > Sent: Friday, February 27, 2015 10:21 PM > To: Dmitry Stogov > Cc: Zeev Suraski; Jordi Boggiano; PHP Internals > Subject: Re: [PHP-DEV] Re: Zend JIT Open Sourced > > Dmitry, > > &g

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Dmitry Stogov
On Fri, Feb 27, 2015 at 11:21 PM, Anthony Ferrara wrote: > Dmitry, > > > Sneaky sneaky. Also completely fake. > > It's been brought to my attention that some people have taken what I > said completely out of context and insinuated it as a direct insult to > you. I assure you that was not the inte

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Dmitry Stogov
On Fri, Feb 27, 2015 at 10:36 PM, Anthony Ferrara wrote: > Dmitry, > > >> That's not to say there's anything wrong with this approach, nor that > >> there isn't a ton we can learn from it. I think it's a fantastic > >> research effort and plan on digging through it myself. Thank you for > >> open

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Anthony Ferrara
Dmitry, > Sneaky sneaky. Also completely fake. It's been brought to my attention that some people have taken what I said completely out of context and insinuated it as a direct insult to you. I assure you that was not the intent (I called the benchmark sneaky and fake, which it is). So if you in

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Dmitry Stogov
On Fri, Feb 27, 2015 at 10:36 PM, Anthony Ferrara wrote: > Dmitry, > > >> That's not to say there's anything wrong with this approach, nor that > >> there isn't a ton we can learn from it. I think it's a fantastic > >> research effort and plan on digging through it myself. Thank you for > >> open

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Anthony Ferrara
Dmitry, >> That's not to say there's anything wrong with this approach, nor that >> there isn't a ton we can learn from it. I think it's a fantastic >> research effort and plan on digging through it myself. Thank you for >> open sourcing it. > > > Thanks for good words :) > > This work may be adop

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Dmitry Stogov
On Fri, Feb 27, 2015 at 9:55 PM, Anthony Ferrara wrote: > Zeev, > > >> Right now it compiles script (php file) at once. > >> So yes, our JIT uses some kind of AOT approach, but completely > >> transparently for the rest of PHP. > > > > Just to slightly further clarify - we don't compile the whole

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Anthony Ferrara
Zeev, >> Right now it compiles script (php file) at once. >> So yes, our JIT uses some kind of AOT approach, but completely >> transparently for the rest of PHP. > > Just to slightly further clarify - we don't compile the whole codebase at > once, but we keep the existing semantics that every file

RE: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Zeev Suraski
> -Original Message- > From: Dmitry Stogov [mailto:dmi...@zend.com] > Sent: Friday, February 27, 2015 7:31 PM > To: Anthony Ferrara > Cc: Jordi Boggiano; PHP Internals > Subject: Re: [PHP-DEV] Re: Zend JIT Open Sourced > > On Fri, Feb 27, 2015 at 7:30 PM,

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Dmitry Stogov
On Fri, Feb 27, 2015 at 7:30 PM, Anthony Ferrara wrote: > Dmitry, > > > > It's not a single request cycle. JIT integrated into opcache, it compiles > > php script(s) of first access and stores code in shared memory. > > On following requests precompiled code is executed directly from shared > > m

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Anthony Ferrara
Dmitry, > It's not a single request cycle. JIT integrated into opcache, it compiles > php script(s) of first access and stores code in shared memory. > On following requests precompiled code is executed directly from shared > memory. > > - The first request may be extremely slow (few minutes) Th

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Rowan Collins
Dmitry Stogov wrote on 27/02/2015 15:56: On Fri, Feb 27, 2015 at 6:40 PM, Jordi Boggiano wrote: >On 27/02/2015 15:19, Andi Gutmans wrote: > >> >> On Feb 27, 2015, at 7:12 AM, Anthony Ferrara >>>wrote: >>> >>>Dmitry and Zend, >>> >>>Thank you for sharing your code. I look forward to playing

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Dmitry Stogov
On Fri, Feb 27, 2015 at 6:40 PM, Jordi Boggiano wrote: > On 27/02/2015 15:19, Andi Gutmans wrote: > >> >> On Feb 27, 2015, at 7:12 AM, Anthony Ferrara >>> wrote: >>> >>> Dmitry and Zend, >>> >>> Thank you for sharing your code. I look forward to playing with it. >>> >>> Perhaps after 7 stabiliz

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Jordi Boggiano
On 27/02/2015 15:19, Andi Gutmans wrote: On Feb 27, 2015, at 7:12 AM, Anthony Ferrara wrote: Dmitry and Zend, Thank you for sharing your code. I look forward to playing with it. Perhaps after 7 stabilizes (and ships) you could write up your thoughts around it? Why decisions were made and th

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Sebastian Bergmann
Am 27.02.2015 um 16:12 schrieb Anthony Ferrara: > Thank you for sharing your code. I look forward to playing with it. > > Perhaps after 7 stabilizes (and ships) you could write up your > thoughts around it? Why decisions were made and the findings that you > have? What Joe and Anthony said :-) T

Re: [PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Andi Gutmans
> On Feb 27, 2015, at 7:12 AM, Anthony Ferrara wrote: > > Dmitry and Zend, > > Thank you for sharing your code. I look forward to playing with it. > > Perhaps after 7 stabilizes (and ships) you could write up your > thoughts around it? Why decisions were made and the findings that you > have?

[PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Anthony Ferrara
Dmitry and Zend, Thank you for sharing your code. I look forward to playing with it. Perhaps after 7 stabilizes (and ships) you could write up your thoughts around it? Why decisions were made and the findings that you have? Thanks again Anthony On Fri, Feb 27, 2015 at 7:10 AM, Dmitry Stogov w

[PHP-DEV] Re: Zend JIT Open Sourced

2015-02-27 Thread Joe Watkins
Dmitry, Thanks for the opportunity to read, that's cool ;) Cheers Joe On Fri, Feb 27, 2015 at 12:10 PM, Dmitry Stogov wrote: > Hi, > > With the recent discussions of JIT/AOT and the good progress we made on > PHP-7, we decided to open up the JIT experiment we've been working on. > > https: