Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56855 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28647 invoked from network); 9 Dec 2011 14:25:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2011 14:25:51 -0000 Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain punkave.com designates 209.85.216.49 as permitted sender) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.216.49 mail-qw0-f49.google.com Received: from [209.85.216.49] ([209.85.216.49:61136] helo=mail-qw0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/48-06429-D6A12EE4 for ; Fri, 09 Dec 2011 09:25:49 -0500 Received: by qadc16 with SMTP id c16so2226365qad.8 for ; Fri, 09 Dec 2011 06:25:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.105.11 with SMTP id r11mr7244380qao.68.1323440746488; Fri, 09 Dec 2011 06:25:46 -0800 (PST) Received: by 10.229.93.200 with HTTP; Fri, 9 Dec 2011 06:25:46 -0800 (PST) In-Reply-To: References: <4EE14E10.5050403@lerdorf.com> <4EE1534A.5070701@lerdorf.com> Date: Fri, 9 Dec 2011 09:25:46 -0500 Message-ID: To: Rasmus Schultz Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Phalanger From: tom@punkave.com (Tom Boutell) Rasmus, I'm looking at that first chart you linked to, the one about real world Wordpress performance. It has three lines on it. The terrible one is standard PHP without a bytecode cache. Nobody in their right mind runs PHP without a bytecode cache. It's only there to make the chart look more exciting. The second one is standard PHP (the Zend VM) with Wincache. Wincache is a Microsoft-supplied alternative to APC for the Windows platform. Fine by me since APC seemed semi-orphaned on Windows the last time I checked. Whatever, a bytecode cache is a bytecode cache. The third line is Phalanger. And yes, it's a little faster than standard PHP with a reasonable cache installed. But not much. The micro-benchmarks for individual features are more interesting, but I'd like to know why they don't matter so much in practice. On Fri, Dec 9, 2011 at 8:58 AM, Rasmus Schultz wrote: > You want to compare Mono performance to .NET performance - I'm sorry, but I > don't see how that's even relevant? > > Your benchmark would be relevant if I was proposing you write a PHP > interpreter and run that on Mono. > > What I'm proposing (and what Phalanger does) is to compile PHP code to CLR > bytecode, and running it directly on the VM - I'm not saying run an > interpreter under the VM. That would be pointless. > > So what you should be comparing, is Mono performance against PHP > performance. What you should be comparing is probably something closer to > this: > > http://shootout.alioth.debian.org/u64q/performance.php?test=spectralnorm > > (and I realize of course that CLR bytecode derived from a dynamic language > like PHP was have a considerably higher runtime overhead than that of a > static language like C#, but it should still be orders of magnitude faster > than an interpreter.) > > According to the chart you mentioned, Mono performance on Linux is > comparable to that of Java - which has performed adequately to support a > very large industry and thousands of languages. > > Sure, .NET is orders of magnitude faster than that. But it is optimized for > a single platform, and if we're looking at cross-platform VM alternatives, > your two best choices are Mono and Java - .NET should not even be in that > chart, except for the sake of argument that Mono has room for optimization > still. > > Also, according to your chart, Mono has considerably lower memory usage, > which could be relevant when running highly parallelized applications such > as web-services. > > Here's another chart I'm sure you've all seen, comparing the Windows build > of PHP to Phalanger: > > http://www.php-compiler.net/benchmarks > > Yes, performance is worse under Linux - probably around half the speed you > get under .NET on Windows. Does that mean it's going to be slower under > Mono than the Zend VM? I would say not likely. But I guess we'll have to > wait for a Linux PHP vs Linux Phalanger benchmark to know for sure... > > - Rasmus > > > On Thu, Dec 8, 2011 at 7:16 PM, Rasmus Lerdorf wrote: > >> On 12/08/2011 03:53 PM, Rasmus Lerdorf wrote: >> > This is a complete non-starter. The bulk of PHP users are on >> > non-Windows, especially Linux, and Mono performance on Linux is really >> > not good. Last time I checked it was an order of magnitude slower on >> > Linux compared to the same hardware running Windows. Granted that was >> > quite a few years ago now and I assume it is no longer 10x slower. >> > Perhaps it is up to 4x or even 2x slower. >> >> Here are some more recent numbers to back that up: >> >> http://www.codeproject.com/KB/dotnet/RuntimePerformance.aspx >> >> Basically what you are suggesting is that we replace the Green bar there >> with the Grey one. Note that lower is better. This does show that Mono >> performance is starting to approach .Net performance, at least for this >> benchmark, but it still isn't there. And if you look through the various >> benchmarks you will see that native C/C++ code is 5-10x faster than the >> same code running under Mono. >> >> -Rasmus >> >> -- Tom Boutell P'unk Avenue 215 755 1330 punkave.com window.punkave.com