Don't take this the wrong way, I'm merely trying to provoke your thoughts a
bit with this e-mail! :-)
Has it occurred to anyone, to abandon the official PHP codebase and adopt
Phalanger instead?
Some convincing (to me) points:
-
Phalanger runs on Mono, meaning similar platform-reach as PHP. (but
eliminating most platform-specific implementations.) -
It's fast. (probably fast enough to mostly eliminate the need for native
extensions in general.) -
The community would be able to write modules/extensions in PHP or other
CLR languages. -
It's secure. (not that C/FFI PHP extensions tend not to be trustworthy,
but they do tend to come from a relatively small group of authors.) -
Access to more languages means a much bigger community who can contribute
extensions and core patches. -
Access to existing CLR codebases means more third-party libraries can be
readily integrated without writing and maintainting C/FFI wrappers. -
The codebase is new, clean and modern (it's not dragging around a lot of
legacy baggage.) -
Fully take advantage of new 64-bit hardware (vector computations and
larger address space) in all aspects. (core, extensions, PHP scripts).
I'm not going to try to sell you on the fact that the integration with the
Windows world is tighter in Phalanger than in PHP - but it is a point that
carries considerable weight to many businesses.
People I know have had a tendency to view Phalanger as "PHP for Windows" -
it's really not. It's PHP for CLR - and CLR is not (only) Windows. And it
is readily available on most modern operating systems with good support for
various hardware platforms.
Now, before you start flaming me - I'd love to hear precisely why you're
eager to hang on to the C codebase. What are the benefits of the C codebase
over Phalanger?
I understand the licensing may be an issue. It may be the argument that
outweighs everything else, but I'm curious to hear what else would keep you
from moving to Phalanger?
Thanks!
- Rasmus Schultz
Don't take this the wrong way, I'm merely trying to provoke your thoughts a
bit with this e-mail! :-)Has it occurred to anyone, to abandon the official PHP codebase and adopt
Phalanger instead?Some convincing (to me) points:
Phalanger runs on Mono, meaning similar platform-reach as PHP. (but
eliminating most platform-specific implementations.)It's fast. (probably fast enough to mostly eliminate the need for native
extensions in general.)The community would be able to write modules/extensions in PHP or other
CLR languages.It's secure. (not that C/FFI PHP extensions tend not to be trustworthy,
but they do tend to come from a relatively small group of authors.)Access to more languages means a much bigger community who can contribute
extensions and core patches.Access to existing CLR codebases means more third-party libraries can be
readily integrated without writing and maintainting C/FFI wrappers.The codebase is new, clean and modern (it's not dragging around a lot of
legacy baggage.)Fully take advantage of new 64-bit hardware (vector computations and
larger address space) in all aspects. (core, extensions, PHP scripts).I'm not going to try to sell you on the fact that the integration with the
Windows world is tighter in Phalanger than in PHP - but it is a point that
carries considerable weight to many businesses.People I know have had a tendency to view Phalanger as "PHP for Windows" -
it's really not. It's PHP for CLR - and CLR is not (only) Windows. And it
is readily available on most modern operating systems with good support for
various hardware platforms.Now, before you start flaming me - I'd love to hear precisely why you're
eager to hang on to the C codebase. What are the benefits of the C codebase
over Phalanger?I understand the licensing may be an issue. It may be the argument that
outweighs everything else, but I'm curious to hear what else would keep you
from moving to Phalanger?
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.
-Rasmus
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
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
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
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.
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
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
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.
For this group there's little sense in migrating away - barely anybody
here is used to writing C# code and even less knowledge bout CLR
internals. We're quite used to C, though. Therefore another group has to
do such an implementation (and obviously does) and then users may
decide. So in the end you have to ask users why they won't migrate. Some
reasons I can see are
- PHP in it's current implementation is ubiquitous
- It is proven
- There are people who can administer it
- It is known to be able to scale quite a lot
- It can easily be extended with C to get machine performance where that
matters or to connect to C/C++ libraries - Tons of existing applications are known to work on that platform
- ...
btw. there's not only Phalanger but also Quercus or HiHop, and some
others none of those sees to really attract masses of users.
johannes
Rasmus Lerdorf <rasmus <at> lerdorf.com> writes:
-snip-
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.
- FWIW The relative performance of these C# Mono versus Java programs seems
much the same both on x86 Ubuntu and Vista (dual-boot on the same hardware).
- C# Mono was still slower than C# .Net
http://shootout.alioth.debian.org/demo/benchmark.php?test=all&lang=csharp&lang2=csc
hi,
As a windows developer and user, and core developer of PHP as well as
contributor to many OSS projects to help them to support windows
better and keep the code portable, I'd to say that to base a project
on .net is a wrong start to begin with. A very wrong one. And I really
like .net, I only won't ever consider it for anything where I need
full control (memory, performance, cross platform, etc.). The same
goes for Java btw.
It is also possible to write extension for .net module using C++/CLI
very easily. I have done that a couple of times already (some are
public on github too btw, like the MS Chart module).
As of phalanger, to me it is and remains a toy project, nice
experiment but the way to go is to stick to C (eventually C++ but
there may have even more people against it than .net ;-).
Don't take this the wrong way, I'm merely trying to provoke your thoughts a
bit with this e-mail! :-)Has it occurred to anyone, to abandon the official PHP codebase and adopt
Phalanger instead?Some convincing (to me) points:
Phalanger runs on Mono, meaning similar platform-reach as PHP. (but
eliminating most platform-specific implementations.)It's fast. (probably fast enough to mostly eliminate the need for native
extensions in general.)The community would be able to write modules/extensions in PHP or other
CLR languages.It's secure. (not that C/FFI PHP extensions tend not to be trustworthy,
but they do tend to come from a relatively small group of authors.)Access to more languages means a much bigger community who can contribute
extensions and core patches.Access to existing CLR codebases means more third-party libraries can be
readily integrated without writing and maintainting C/FFI wrappers.The codebase is new, clean and modern (it's not dragging around a lot of
legacy baggage.)Fully take advantage of new 64-bit hardware (vector computations and
larger address space) in all aspects. (core, extensions, PHP scripts).I'm not going to try to sell you on the fact that the integration with the
Windows world is tighter in Phalanger than in PHP - but it is a point that
carries considerable weight to many businesses.People I know have had a tendency to view Phalanger as "PHP for Windows" -
it's really not. It's PHP for CLR - and CLR is not (only) Windows. And it
is readily available on most modern operating systems with good support for
various hardware platforms.Now, before you start flaming me - I'd love to hear precisely why you're
eager to hang on to the C codebase. What are the benefits of the C codebase
over Phalanger?I understand the licensing may be an issue. It may be the argument that
outweighs everything else, but I'm curious to hear what else would keep you
from moving to Phalanger?Thanks!
- Rasmus Schultz
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
Hello,
Don't take this the wrong way, I'm merely trying to provoke your thoughts a
bit with this e-mail! :-)Has it occurred to anyone, to abandon the official PHP codebase and adopt
Phalanger instead?Some convincing (to me) points:
Phalanger runs on Mono, meaning similar platform-reach as PHP. (but
eliminating most platform-specific implementations.)It's fast. (probably fast enough to mostly eliminate the need for native
extensions in general.)The community would be able to write modules/extensions in PHP or other
CLR languages.It's secure. (not that C/FFI PHP extensions tend not to be trustworthy,
but they do tend to come from a relatively small group of authors.)Access to more languages means a much bigger community who can contribute
extensions and core patches.Access to existing CLR codebases means more third-party libraries can be
readily integrated without writing and maintainting C/FFI wrappers.The codebase is new, clean and modern (it's not dragging around a lot of
legacy baggage.)Fully take advantage of new 64-bit hardware (vector computations and
larger address space) in all aspects. (core, extensions, PHP scripts).I'm not going to try to sell you on the fact that the integration with the
Windows world is tighter in Phalanger than in PHP - but it is a point that
carries considerable weight to many businesses.People I know have had a tendency to view Phalanger as "PHP for Windows" -
it's really not. It's PHP for CLR - and CLR is not (only) Windows. And it
is readily available on most modern operating systems with good support for
various hardware platforms.Now, before you start flaming me - I'd love to hear precisely why you're
eager to hang on to the C codebase. What are the benefits of the C codebase
over Phalanger?I understand the licensing may be an issue. It may be the argument that
outweighs everything else, but I'm curious to hear what else would keep you
from moving to Phalanger?
I am not sure the response you are expecting, suggesting to abandon
the PHP project with over a decade of tried and proven work to
architecture that prohibits a great portion of the implementations
very attraction for a majority of large projects... furthermore doing
it on a list full of the very developers who have put in all this time
and effort is almost a bit ridiculous. If PHP ever took away my
freedom to write efficient C extensions for domain specific problems,
library integration or was better favored to a windows world I would
unfortunately have to move to another technology.
I would like to make note in no disrespect to anyone that I think some
graphs showing some bars larger then others, are meaningless to me in
the current state of technology. I haven't had to write a C extension
for performance improvements in years. Scaling web applications is
just so easy, the bottlenecks are almost NEVER in the web tier anymore
and when it does reach capacity provision a new web box and voila.
What is expensive ($$) is data storage and network communication
(performance) to external service providers (fb api, openid, twitter,
internal enterprise services, pick your api).
Just a couple thoughts from me and my experience, in a nut shell it's
great to see work on alternative implementations that better fit a
specific group or set of groups problem domains, but such a drastic
statement as to drop the current implementation and start anew is
pretty far away from logical :- )
-Chris