6 ms·
Php 5.4 vs 5.3: is really fast and with less memory leaks
- effu 15y agoThe title of this post is amusing. Only "less memory leaks"? None would be nicer. (Also "fast" is relative. When you're known for one of the slowest interpreters getting large performance increases is easy. It would be better to bench against something that really is fast, like the JVM for example.)
- richthegeek 15y agoPython & Ruby are both slower interpreted languages than PHP, for all their lovely syntax. The JVM is slower to develop for, and when probably 50% of projects on the web are stuff that's built in less than 2 months, using the JVM adds too much complexity where it really isn't needed. If you want speed (almost) as good as the JVM without using an interpreted language, use Node. Unless of course you only know the one language from your CompSci days..
- odedharth 15y agoOr use JRuby to get the advantages of ruby with the speed of JVM (http://jruby.org/ http://jruby.org/).
- j_col 15y agoI like JRuby a lot, in fact it's my favourite scripting language on the CLI, but while it's fast to run its damn slow to compile (remember it still has to compile to JVM bytecodes).
- __alexs 15y ago> Python & Ruby are both slower interpreted languages than PHP Source? That's not what the Programming Language Benchmark Game says... http://shootout.alioth.debian.org/u64/which-programming-languages-are-fastest.php?calc=chart&v8=on&python3=on&yarv=on&php=on&perl=on http://shootout.alioth.debian.org/u64/which-programming-lang... Although that's probably without an optimiser at all.
- sigzero 15y agoMaybe that should be qualified "in a web context".
- TylerE 15y agoStill a big [citation needed]. Compare with something like cached Mako templates in Python and I seriously doubt it's competitive.
- richthegeek 15y agoCompare it with a micro-cached Varnish or nginx .. caching is outside of the "speed" parameters. Of course, you could take a look memcached if you want :) I can't find the reference I remember but it fits roughly with the link posted (the scale seems to match the max times rather the average times). The differences were tiny but the order was PHP, Python, Ruby if I remember correctly (PHP was in front, PR may have been switched). I'll try get a link but I doubt i'll find it.
- TylerE 15y agoIn the case of Mako at least, caching doesn't mean caching in the way you mean it. It's more akin to opcode caching in PHP, saving the actual python code generated from the template, not the result. Just saves from reparsing the template every time it's rendered, but the actual template logic still runs.
- lucian1900 15y agoI think people often just don't know about recent developments. PyPy is at least as fast as Node, and Rubinius is also very fast.
- mattparlane 15y agoMinor nitpick: the fact that something uses more memory does not mean that it "leaks", using the common definition of the word "leak".
- pilif 15y agoWhy is the title talking about memory leaks? The listed benchmark is comparing "PHP/O+ memory usage". Memory usage isn't memory leaks. Just because something uses a lot of memory doesn't mean it's leaking memory. Only when that used memory never gets freed or reused you can talk of leaks. The linked benchmark isn't taking this into account /at all/. It's just measuring memory usage. From my own experience with PHP, while it's using a lot of memory at times, it doesn't usually leak it, unless you produce code that cause it to leak (circular references before the GC days), but that's really the programmers responsibility.
- kijin 15y agoThe last time I suffered a huge memory leak in PHP was with HTML Purifier on PHP 5.2. It was impossible to process more than a few documents at a time, even from the CLI, because HTML Purifier seemed to leak every byte of memory it used. Lots of circular references. With PHP 5.3 with the new GC and the latest version of HTML Purifier, there is no memory leak anymore. PHP has come a long way since the days when you had to respawn Apache processes every 500 requests.
- mootothemax 15y agoI'm a bit suspicious that Wordpress is listed under req/sec, but is missing from the memory usage table. Hopefully an oversight... unless Wordpress is still the king of memory hogs :)
- robryan 15y agoWouldn't surprise me, the whole thing is fairly monolithic and tightly coupled.
- bergie 15y agoIn our PHPCR tests, it looks like PHP 5.4 is about as fast (or slightly slower) than 5.3, but uses between 25% to 50% of the memory. Note however that this is with heavy usage of compiled PHP extensions like midgard2.
- deleted 15y ago[deleted]
- lutusp 15y ago"Less" memory leaks -- would that be the same number of memory leaks but each of them smaller, or does the author actually mean fewer memory leaks?
- kijin 15y agoActually, the article seems to mean "lower memory usage". It says nothing about memory leaks.
- witherAway 15y agoWhen I was in medical school, I ran into this level of pedantry all the time, especially on the surgical services (We don't "do" surgery, we "perform" surgery; we "do" operations!). Or maybe it's the other way around. Either way, it made me a little sad. Consider ignoring all the literal misappropriations you encounter daily and simply listen to people. It makes for a much more pleasant experience.
- Terretta 15y agoEnglish less is to fewer as JavaScript == is to ===. So if you see someone misuse a term, consider informing them. // less is for general mass, fewer is for countable nouns; == is for general comparison, === is for comparable things of the same type
- mahcuz 15y agoLess grass. Fewer blades of grass. Boom! Grammar.
- batista 15y agoMiguez de Icaza explains here why you're not getting laid (much): http://tirania.org/blog/archive/2011/Feb-17.html http://tirania.org/blog/archive/2011/Feb-17.html
- Terretta 15y agoI suspect personal attacks do more harm to one's social standing than weighing in on an already in progress grammar discussion.
- ck2 15y agoIs "Zend OptimizerPlus" any form of an opcode cache? Ah it is indeed an opcode cache, just wasn't familiar with it as a commercial product http://files.zend.com/help/Zend-Server-IBMi/optimizer_plus_component.htm http://files.zend.com/help/Zend-Server-IBMi/optimizer_plus_c... Good to see the performance boost is maintained with an opcode cache and not negated.
- powertower 15y agoI'd much rather see this with APC benchmarks. I mean, that's supposed to be the native Opcode Cache with PHP! My WAMP distro (http://www.devside.net/server/webdeveloper http://www.devside.net/server/webdeveloper) is switching to it, as it's finally stable enough to use in production (eAccelerator had it beat for some time). Also, Zend Optimizer only works with PHP as a non-thread-safe / FCGI process in PHP 5.3, so there goes it's use under the prefered Windows mod_php setup (Windows handles threads really well). The only time you want to use FCGI on Windows is if there are serious memory leaks. It's hard to ignore Windows as a PHP paltform considering it's the majority of the webdev segment for PHP and about 1/3 of production for PHP.
- opendomain 15y ago.. It's hard to ignore Windows as a PHP paltform Wait - What? I use both Windows and Nix, and have always moved to Nix for better speed and security. Do you have links to this statistic? I would prefer to use 64Bit, but there is no current support for it in PHP.
- powertower 15y agoPeople from Apache, PHP and MySQL have published stats (in conferences and points) that show the Windows and Linux deployment figures for downloads, development work, and production deployments, over the years. The majority of dev work (like local website development and testing) with Apache, PHP, and MYSQL was under Windows. 1/3 of production work was also Windows. This was several years ago and I have seen these numbers increasing in Windows favor.