Live data from Hacker News

Pux – High Performance Router for PHP

github.com

31–40 of 58 posts

Re: Pux – High Performance Router for PHP

#31

Thanks for your contribution! Always love seeing new attempts with PHP. While I 100% appreciate your efforts, there are a few really big questions or problems I have with the way this has been presented. As a PHP developer, I hope you don't mind me addressing them here. 1) You benchmarked a large framework with all sorts of features and functionality against a very specific library with a few files. What about all of…

w.r.t. your point 3, symfony modules do sometimes require a one-off command to re-generate cached data after a deploy of new code.

an example of this is the assetic asset manager. during development you can tell assetic to compile assets dynamically, but when you do a deploy to live, you generally run:

    php app/console assetic:dump --env=prod
if your app is configured properly this will take all css and js and compile/minify for production. it's a bit of extra "work", but well worth it for the performance benefit.

so yes, it does appear that performance measurements being shown are comparing apples to oranges. however, if developers are willing to go through the extra steps to get this working, it wouldn't be out of line with other symfony framework practices.

Re: Pux – High Performance Router for PHP

#32
post #30

My personal opinion is that either no symfony and no pux should exist. There's no need to reinvent frameworks in PHP as PHP is the framework already. There's no need to reinvent templating in PHP as PHP is the templating already. If you require different productivity from a language just don't stick on PHP and make the right choice by using the most appropriate language for you. There's plenty out there. PHP is great…

Exactly. You don't need a 'router' when you have the filesystem and mod_rewrite.

Re: Pux – High Performance Router for PHP

#33
post #30

My personal opinion is that either no symfony and no pux should exist. There's no need to reinvent frameworks in PHP as PHP is the framework already. There's no need to reinvent templating in PHP as PHP is the templating already. If you require different productivity from a language just don't stick on PHP and make the right choice by using the most appropriate language for you. There's plenty out there. PHP is great…

If you're building a web application in PHP, then symfony is a huge improvement over naked php files or rolling your own bootstrapped system. Right out of the box it addresses concerns of security, user management, routing, persistence, and myriads of the other basic needs of a web system. Packages for many common components are already built, meaning you can get sophisticated functionality working quickly. It is modular enough that you can include only the components you need.

The built-in templating language, twig, actually provides a number of benefits over bare PHP templating. It addresses security concerns, has a concise and clean syntax, and compiles down to optimised PHP template code, minimising the performance hit.

If you are suggesting that PHP shouldn't be used for web applications, and should only be used for basic templating, I would be interested to know what you consider to be an "appropriate language".

Re: Pux – High Performance Router for PHP

#34
post #30

My personal opinion is that either no symfony and no pux should exist. There's no need to reinvent frameworks in PHP as PHP is the framework already. There's no need to reinvent templating in PHP as PHP is the templating already. If you require different productivity from a language just don't stick on PHP and make the right choice by using the most appropriate language for you. There's plenty out there. PHP is great…

Too many people are losing sight of the power of 'pure' PHP and jumping on the framework wagon unnecessarily. That doesn't surprise me, as frameworks provide structure and rules to a language that is very messy.

Re: Pux – High Performance Router for PHP

#36
post #33
post #30

My personal opinion is that either no symfony and no pux should exist. There's no need to reinvent frameworks in PHP as PHP is the framework already. There's no need to reinvent templating in PHP as PHP is the templating already. If you require different productivity from a language just don't stick on PHP and make the right choice by using the most appropriate language for you. There's plenty out there. PHP is great…

If you're building a web application in PHP, then symfony is a huge improvement over naked php files or rolling your own bootstrapped system. Right out of the box it addresses concerns of security, user management, routing, persistence, and myriads of the other basic needs of a web system. Packages for many common components are already built, meaning you can get sophisticated functionality working quickly. It is mod…

Look at the php.net website source code. Another example could be the Wordpress source code. It's not handsome code, but it just works.

Things like fat (either slim) frameworks should be memory resident (java or similar), not reloaded from scratch at each web request, it just won't never perform on big sites. Alternatively, if you need to deal with bigger applications, or massive traffic, you can build some kind of backend memory resident application (c, c++, java, go...) and delegate the hard work to it by using a lightweight rpc protocol (see messagepack, thrift, protobuf), and leave PHP alone to do the job it's born for.

Also, the choice to adopt a framework is serious stuff, it firstly should be well designed and maintained, then it should suit exactly your needs and more importantly you should not just use it, but learn conventions and write your code by sticking on them or else all your code will result in a bad mess.

Re: Pux – High Performance Router for PHP

#39
post #36
post #33

Earlier quoted context omitted.

If you're building a web application in PHP, then symfony is a huge improvement over naked php files or rolling your own bootstrapped system. Right out of the box it addresses concerns of security, user management, routing, persistence, and myriads of the other basic needs of a web system. Packages for many common components are already built, meaning you can get sophisticated functionality working quickly. It is mod…

Look at the php.net website source code. Another example could be the Wordpress source code. It's not handsome code, but it just works. Things like fat (either slim) frameworks should be memory resident (java or similar), not reloaded from scratch at each web request, it just won't never perform on big sites. Alternatively, if you need to deal with bigger applications, or massive traffic, you can build some kind of b…

Wordpress is "not handsome code" and has been the source of massive security holes for a decade.

Symfony has problems, to be sure, but it at least establishes certain levels of sanity that you have to do something stupid to break.

Re: Pux – High Performance Router for PHP

#40
post #16

If they would only first explain what the heck is "routing in PHP"... Coming from the network programming side of things, "High Performance PHP Router" sounds like a spectacular oxymoron at best :)

I agree ... many PHP devs seem to think that programming only exists between when the web server gives a request to a PHP process and when that process closes it's STDOUT handle to complete the response.

Why PHP devs? Aren't "routing" libraries also available in other popular languages with frameworks? Are those devs somehow beyond reproach?
Post reply on HN