tag:blogger.com,1999:blog-6669934595599937894.post3538242048814608814..comments2023-09-07T08:05:54.807-07:00Comments on Obvious Hints: Symfony Speed and Hello World BenchmarksAlvarohttp://www.blogger.com/profile/05177930414107959806noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-6669934595599937894.post-88072650417401853372010-02-06T16:13:53.675-08:002010-02-06T16:13:53.675-08:00Perhaps they are defending those benchmarks, becau...Perhaps they are defending those benchmarks, because your post starts <b>"After reading some posts showing that my blah blah framework is way more fast than symfony for a Hello World application I decided to explain why: because symfony is extensible and can adapt to your needs."</b> which seems to be you saying Symfony is slow because it has these features, the problem being other frameworks also have those features, so your reasoning doesn't really hold up, you asked for an example of how other frameworks implement these things so I'll give you one (I'm not going to go through the lot, life is too short), but anyway.<br /><br />Factories - overriding default classes, in codeigniter for example the default classes are stored in the libraries folder, on the same level is the app/ folder which contains rather unsurprisingly contains all the files you add, in that app folder is another folder called libraries, Codeigniter checks their first before the overall libraries folder a level up, so to override a base class simply place your class there.Unknownhttps://www.blogger.com/profile/15710453481229836496noreply@blogger.comtag:blogger.com,1999:blog-6669934595599937894.post-51415529878357210732009-06-20T14:56:56.644-07:002009-06-20T14:56:56.644-07:00All sheer lunacy, in ALL the frameworks die('H...All sheer lunacy, in ALL the frameworks die('Hello World'); is the fastest! If you "remove all that you don't need for benchmarks" then why not just run this code? So silly... What about ADDING plugins to each of the framework like in symfony sfSuperCache ?? Benchmark that? <br /><br />A bunch of what if nonsense ..Jarrethttps://www.blogger.com/profile/07977020994208010710noreply@blogger.comtag:blogger.com,1999:blog-6669934595599937894.post-17662105115613328892009-03-04T01:36:00.000-08:002009-03-04T01:36:00.000-08:00@mweierophinney"ZF uses both convention and config...@mweierophinney<BR/><BR/>"ZF uses both convention and configuration -- but has sane defaults, which means that no configuration is necessary"<BR/><BR/>Symfony does that too. Init a project and application from the command line and you get your app up and running, zero configuration on your said.<BR/><BR/>"I would never, ever base a decision on which framework to use on these statistics" <BR/><BR/>Me too :-)<BR/><BR/>"I might, however, develop my application differently from the outset knowing this information."<BR/><BR/>I won't do any kind of premature optimization based in a hello world application benchmark. I will base my optimization based on how my application behaves in real life. <BR/><BR/>And in my post I'm showing how symfony works, so the developer can get an idea of what to expect from the framework. I even don't understand why you or @pmjones are defending the benchmarks on this article: http://paul-m-jones.com/?p=315Alvaro Videlahttps://www.blogger.com/profile/07031263601534602454noreply@blogger.comtag:blogger.com,1999:blog-6669934595599937894.post-37878063582358332302009-03-03T21:05:00.000-08:002009-03-03T21:05:00.000-08:00@Alvaro -- ZF uses both convention and configurati...@Alvaro -- ZF uses both convention and configuration -- but has sane defaults, which means that no configuration is necessary. Add a DB to the mix, and you need configuration. But ZF's approach to configuration is to do as much of it at the PHP level as possible -- no configuration files by default. You <I>can</I> use configuration files, but you don't need to. Configuration !== configuration file; configuration can also simply mean setting object state.<BR/><BR/>However, the point is, at the most basic level -- outputting a static page -- what is the fastest that a framework can provide? That's where @pmjones' benchmarks compare apples to apples, and it's the sole point of those benchmarks. It's not about which framework is fastest, it's about having some baseline for comparison down the road.<BR/><BR/>If you add a DB or web services into the mix, that number will decrease (as in, fewer requests per second). Add caching, however, and that number may increase. But the point is: what do I <I>start</I> with? And then you bench again later, after most of the application logic is in place. And then you bench again more when you have a variety of caching strategies in place.<BR/><BR/>I would never, ever base a decision on which framework to use on these statistics. I might, however, develop my application differently from the outset knowing this information. (E.g, do aggressive, granulated caching from the outset.)Matthew Weier O'Phinneyhttps://www.blogger.com/profile/07032108589083372184noreply@blogger.comtag:blogger.com,1999:blog-6669934595599937894.post-44466045858873513992009-03-03T16:53:00.000-08:002009-03-03T16:53:00.000-08:00@mweierophinney I understand his point and yours a...@mweierophinney I understand his point and yours also. But I don't see the goal of this kind of benchmarks. As @skoop said on twitter, I feel that this is like comparing pears and apples. <BR/><BR/>Now, can you please tell me if you don't need configuration to work, how does all the other frameworks nows how to connect to you project specific database? Or how to know what Front Controller to use, etc.? If that is not configuration, what is then? <BR/><BR/>And I don't want to start a flame war between frameworks, because that is stupid. I think that all of them have something to cool to give to the community, that's why people use them.Alvaro Videlahttps://www.blogger.com/profile/07031263601534602454noreply@blogger.comtag:blogger.com,1999:blog-6669934595599937894.post-30549048572921056292009-03-03T09:12:00.000-08:002009-03-03T09:12:00.000-08:00@Alvaro -- what @pmjones is suggesting is that eac...@Alvaro -- what @pmjones is suggesting is that each of the frameworks he benchmarks implement similar functionality. He's not suggesting that the functionality is implemented in the same way or loads the same number of files from disk -- in fact, far from it. Each implements these features in very different ways, and some will do so with more or fewer files. ZF, for instance, allows for cascading configuration -- but you don't <I>need</I> configuration for an application to work (unlike symfony).<BR/><BR/>The primary thing, however, is that @pmjones' benchmarks show the <I>baseline</I> performance -- i.e., what is the fastest an application written in a framework can run without adding any caching or external dependencies (such as database, web services, etc.). As such, his methodology is sound, and the benchmarks have value.<BR/><BR/>Should benchmarks against comparable applications also be made? Probably. But it would take a concerted effort by developers versed in each of the frameworks to do so, and I'm guessing that won't happen anytime in the near future.Matthew Weier O'Phinneyhttps://www.blogger.com/profile/07032108589083372184noreply@blogger.comtag:blogger.com,1999:blog-6669934595599937894.post-90321262309273565102009-03-03T08:39:00.000-08:002009-03-03T08:39:00.000-08:00Well Jacky what can I say... Your comment deserves...Well Jacky what can I say... Your comment deserves a blog post on it's own!<BR/><BR/>Thanks for bringing your JAVA experience to the symfony community so we all can learn from each others :-)Alvaro Videlahttps://www.blogger.com/profile/07031263601534602454noreply@blogger.comtag:blogger.com,1999:blog-6669934595599937894.post-51821622248093424262009-03-03T08:29:00.000-08:002009-03-03T08:29:00.000-08:00nice article. compared with struts(the mvc framewo...nice article. <BR/>compared with struts(the mvc framework in Java), i like symfony more. Because it's easier to user and faster to implement. Maybe we would give thanks to the agile nature of PHP. <BR/><BR/>But both of them have some same features more or less:<BR/><BR/>the Factories: In struts 1, it depended on the well-form nature of java. you can extend or implement class from the framwork core classes. With struts 2, it uses the famous "Sping" lib. The concept of Ioc (inverse on control) give developers a better chance to extend and replace the logic of the original framework without changing any code. actually ioc is everywhere in struts 2 from populating request parameters to actions to getting a DAO object. If symforny could involve Ioc, i think it will be more attractive.<BR/><BR/>Filter Chain: 5 years ago,(struts 1 for instance), we just used filter in Java. here filter is a real filter which basically pre-excute some logic before the main one. But in struts 2, it changes the name to interceptors which do the same as "Filter chain" in symfony. But what can be improved is : symfony should have a interface-like class (maybe abstract class) who contains 2 method : preExecute() and postExecute(), then any subclass 's logic is much clear. Since i've seen some bug caused by putting post-execute-logic wrongly before process() by mistake.<BR/><BR/>Configuration Cascade: very nice feature. struts should learn more from this(to improve at least). But now grails (something like symfony,rails in Groovy running in JVM) has this. btw rails 1.2 's performance is much better than before.<BR/><BR/>plugin: as developer, u can make your own plugin easily for both frameworks. and the plugin repository has a lot off-the-shelf plugins. But since symfony auto-load mechanism is not robust as java's, it will loose for performance sake.<BR/><BR/>Controller adaptability: as said before, with Ioc you can easily extend it to meet your need. <BR/><BR/>View: same as Controller. in java, you can also choose which tech you would like to render the page. like freemarker, Velocity, or the traditional JSP page. very flexible, right?<BR/><BR/><BR/>why i like symfony more: <BR/>1. it has command-line utilities which speed up development and save you from the boring configurations and machine steps.<BR/>(grails has the same functionality, so i like grails as well :))<BR/><BR/>2. symfony cooperate very well with html tags and Ajax. i have bad impress of ajax support in struts and not good experience with tags. Symfony does it really good. Especially for ajax support, the built-in is for prototype, and you can easily switch to jquery using plugin. <BR/><BR/>there is a lot to say, like the model level, performance tuning, memcache......<BR/><BR/>hope we can talk more shortly.Jacky Hunghttps://www.blogger.com/profile/08855783113903406430noreply@blogger.comtag:blogger.com,1999:blog-6669934595599937894.post-76509871521260997532009-03-03T07:55:00.000-08:002009-03-03T07:55:00.000-08:00Hi,Can you explain how all those frameworks implem...Hi,<BR/><BR/>Can you explain how all those frameworks implement those features? i. e.: Show what's the magic recipe that they follow to load the same amount of data from disc and then be faster? AFAIK as I know about ZF, it doesn't perform all of the checks that symfony does on the controller dispatch method. I may be wrong tough. <BR/><BR/>Do you know how symfony works inside in it's core as you call it in your article?Alvaro Videlahttps://www.blogger.com/profile/07031263601534602454noreply@blogger.comtag:blogger.com,1999:blog-6669934595599937894.post-17295622217429721532009-03-03T07:44:00.000-08:002009-03-03T07:44:00.000-08:00All of the frameworks I benchmark in "hello world"...All of the frameworks I benchmark in "hello world" situations (aka "baseline responsiveness" comparisons) implement *all* of the things you mention. Cake, Symfony, Solar, and Zend all implement some form of factories, filter chains, configurations, controller adaptability, and view adaptability.<BR/><BR/>http://paul-m-jones.com/?p=315<BR/><BR/>You will need to do better than that to show why Symfony is special and different.Paul M. Joneshttps://www.blogger.com/profile/07917343126799588305noreply@blogger.com