Silex AiP example

100 views
Skip to first unread message

Henri Bergius

unread,
May 11, 2011, 9:45:44 AM5/11/11
to aip-p...@googlegroups.com
Hi,

Still needs quite a bit of cleanup, but:

https://github.com/bergie/Silex/tree/master/example/AiP

--
Henri Bergius
Motorcycle Adventures and Free Software
http://bergie.iki.fi/

Skype: henribergius
Jabber: henri....@gmail.com
Microblogs: @bergie

Alexey Zakhlestin

unread,
May 11, 2011, 9:53:29 AM5/11/11
to aip-p...@googlegroups.com
On May 11, 2011, at 5:45 PM, Henri Bergius wrote:

> Hi,
>
> Still needs quite a bit of cleanup, but:
>
> https://github.com/bergie/Silex/tree/master/example/AiP

Cool! Did you show it to Fabien?

Henri Bergius

unread,
May 11, 2011, 10:02:35 AM5/11/11
to aip-p...@googlegroups.com
On Wed, May 11, 2011 at 4:53 PM, Alexey Zakhlestin <inde...@gmail.com> wrote:
>> https://github.com/bergie/Silex/tree/master/example/AiP
>
> Cool! Did you show it to Fabien?

Not yet, but discussing it on symfony-dev

Henri Bergius

unread,
May 13, 2011, 6:07:10 AM5/13/11
to aip-p...@googlegroups.com
On Wed, May 11, 2011 at 4:53 PM, Alexey Zakhlestin <inde...@gmail.com> wrote:
>> Still needs quite a bit of cleanup, but:
>>
>> https://github.com/bergie/Silex/tree/master/example/AiP
>
> Cool! Did you show it to Fabien?

BTW, this is now on Hacker News: http://news.ycombinator.com/item?id=2543914

Interesting point is that AiP + Silex (at least in this trivial
example) is faster and uses less memory than Node.js

AiP:
13958 bergie 20 0 125m 10m 2136 S 1 0.6 0:00.28 php
13959 bergie 20 0 125m 10m 2136 S 1 0.6 0:00.31 php
3.80 transactions per second

Node.js
14051 bergie 20 0 615m 12m 4988 S 0 0.7 0:00.34 node
3.79 transactions per second

--
Henri Bergius
Motorcycle Adventures and Free Software
http://bergie.iki.fi/

Jabber: henri....@gmail.com
Microblogs: @bergie

Igor Wiedler

unread,
May 13, 2011, 6:57:14 AM5/13/11
to AiP development
Sorry, but benchmarking hello world really is pointless.

Lukas Kahwe Smith

unread,
May 13, 2011, 6:59:03 AM5/13/11
to aip-p...@googlegroups.com

On 13.05.2011, at 12:57, Igor Wiedler wrote:

> Sorry, but benchmarking hello world really is pointless.


not totally pointless, but of course shouldnt be used as more as an indication of a real application. but it does tell you a ballpark figure and as such the results are quite promising.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org

Henri Bergius

unread,
May 13, 2011, 7:02:46 AM5/13/11
to aip-p...@googlegroups.com
On Fri, May 13, 2011 at 1:59 PM, Lukas Kahwe Smith <m...@pooteeweet.org> wrote:
> not totally pointless, but of course shouldnt be used as more as an indication of a real application. but it does tell you a ballpark figure and as such the
> results are quite promising.

Yep. I think the differences of the PHP and async Node.js approaches
will show more when you add some I/O and templating to the mix.

> Lukas Kahwe Smith

/Henri

Pas

unread,
May 13, 2011, 12:14:18 PM5/13/11
to aip-p...@googlegroups.com
On 2011.05.13. 12:07, Henri Bergius wrote:
> On Wed, May 11, 2011 at 4:53 PM, Alexey Zakhlestin<inde...@gmail.com> wrote:
>>> Still needs quite a bit of cleanup, but:
>>>
>>> https://github.com/bergie/Silex/tree/master/example/AiP
>>
>> Cool! Did you show it to Fabien?
>
> BTW, this is now on Hacker News: http://news.ycombinator.com/item?id=2543914
>
> Interesting point is that AiP + Silex (at least in this trivial
> example) is faster and uses less memory than Node.js
>
> AiP:
> 13958 bergie 20 0 125m 10m 2136 S 1 0.6 0:00.28 php
> 13959 bergie 20 0 125m 10m 2136 S 1 0.6 0:00.31 php
> 3.80 transactions per second
>
> Node.js
> 14051 bergie 20 0 615m 12m 4988 S 0 0.7 0:00.34 node
> 3.79 transactions per second
>


Doesn't node uses the V8 JS engine, which is a JIT-ing son of a .. plus
JS is a bit more high-level than PHP, that could explain the memory
differences. But the best would be to take a look at /proc/[pid]/maps .

And I'm more suprised that there isn't any significant difference in speed.

--
Pas

Henri Bergius

unread,
May 13, 2011, 1:30:29 PM5/13/11
to aip-p...@googlegroups.com
Hi,

On Fri, May 13, 2011 at 7:14 PM, Pas <past...@gmail.com> wrote:
> And I'm more suprised that there isn't any significant difference in speed.

On my blog somebody commented about running Node.js in production mode
for the benchmark. While this didn't affect memory usage, it made Node
a bit faster than AiP (4.24 t/s vs. 4.06 t/s). I wonder if bytecode
cache or similar optimizations would do more boost for the PHP
implementation.

> Pas

/Henri

Alexey Zakhlestin

unread,
May 13, 2011, 2:29:17 PM5/13/11
to aip-p...@googlegroups.com

On May 13, 2011, at 9:30 PM, Henri Bergius wrote:

Hi,

On Fri, May 13, 2011 at 7:14 PM, Pas <past...@gmail.com> wrote:
And I'm more suprised that there isn't any significant difference in speed.

On my blog somebody commented about running Node.js in production mode
for the benchmark. While this didn't affect memory usage, it made Node
a bit faster than AiP (4.24 t/s vs. 4.06 t/s). I wonder if bytecode
cache or similar optimizations would do more boost for the PHP
implementation.

it shouldn't. bytecode cache doesn't make sense for constantly-running application.
on the other hand, APC had some support for optimization plugins. using one of those can make execution faster.

also, upgrade to php-next can make AiP faster, as zend engine was optimized on trunk

and, finally, there's always option of optimizing AiP's codebase ;)

Lukas Kahwe Smith

unread,
May 13, 2011, 2:36:37 PM5/13/11
to aip-p...@googlegroups.com

On 13.05.2011, at 20:29, Alexey Zakhlestin wrote:

>
> On May 13, 2011, at 9:30 PM, Henri Bergius wrote:
>
>> Hi,
>>
>> On Fri, May 13, 2011 at 7:14 PM, Pas <past...@gmail.com> wrote:
>>> And I'm more suprised that there isn't any significant difference in speed.
>>
>> On my blog somebody commented about running Node.js in production mode
>> for the benchmark. While this didn't affect memory usage, it made Node
>> a bit faster than AiP (4.24 t/s vs. 4.06 t/s). I wonder if bytecode
>> cache or similar optimizations would do more boost for the PHP
>> implementation.
>
> it shouldn't. bytecode cache doesn't make sense for constantly-running application.
> on the other hand, APC had some support for optimization plugins. using one of those can make execution faster.
> see http://pecl.php.net/package/optimizer

yeah unfortunately this extension has been lingering. i have seen ilia ponder getting on it a few times on IRC.
anyway, is AiP compatible with the zend optimizer?
http://static.zend.com/topics/Zend-Optimizer-User-Guide-v330-new.pdf

then again it seems like the product is not available anymore or maybe its bundled inside their server offerings?

Alexey Zakhlestin

unread,
May 13, 2011, 4:20:22 PM5/13/11
to aip-p...@googlegroups.com

On May 13, 2011, at 10:36 PM, Lukas Kahwe Smith wrote:

anyway, is AiP compatible with the zend optimizer?
http://static.zend.com/topics/Zend-Optimizer-User-Guide-v330-new.pdf

then again it seems like the product is not available anymore or maybe its bundled inside their server offerings?

got no idea :-)
I never tried it. It should be ok, If Zend Optimizer supports php-5.3, I guess

Reply all
Reply to author
Forward
0 new messages