Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56854 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23823 invoked from network); 9 Dec 2011 13:58:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2011 13:58:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.161.170 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:50315] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/77-06429-E0412EE4 for ; Fri, 09 Dec 2011 08:58:39 -0500 Received: by ggnv1 with SMTP id v1so3639353ggn.29 for ; Fri, 09 Dec 2011 05:58:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.7.42 with SMTP id g10mr479863oba.45.1323439115196; Fri, 09 Dec 2011 05:58:35 -0800 (PST) Received: by 10.182.44.130 with HTTP; Fri, 9 Dec 2011 05:58:35 -0800 (PST) In-Reply-To: <4EE1534A.5070701@lerdorf.com> References: <4EE14E10.5050403@lerdorf.com> <4EE1534A.5070701@lerdorf.com> Date: Fri, 9 Dec 2011 08:58:35 -0500 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d0444694357d8fb04b3a92e23 Subject: Re: [PHP-DEV] Phalanger From: rasmus@mindplay.dk (Rasmus Schultz) --f46d0444694357d8fb04b3a92e23 Content-Type: text/plain; charset=ISO-8859-1 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 > > --f46d0444694357d8fb04b3a92e23--