Re: PHP console script vs C/C++/C#
| From: | Nick Stinemates | Date: | Fri, 18 Apr 2008 17:25:05 +0000 |
| Subject: | Re: PHP console script vs C/C++/C# | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-273254@lists.php.net to get a copy of this message | ||
On Fri, Apr 18, 2008 at 09:58:14AM -0600, Nathan Nobbe wrote:
> On Thu, Apr 17, 2008 at 5:46 PM, Nick Stinemates <nick@stinemates.org>
> wrote:
>
> > > If I wrote the console application in a c language (and compiled) would
> > one
> > > expect to see any improvements in performance? If so, how much
> > improvement
> > > could one expect (in general)?
> >
> > Depends. Shitty algorithms are shitty, regardless of language
> > implementation.
> >
>
>
> right, but there shitiness is relative to the performance of the underlying
> language. according to the great computer language shootout, if OP
> implemented in C / C++ he could expect something along the lines an increase
> in performace ~ 23x greater than the current php implementation. obviously
> there are many factors here; and well i dont think weve even found out what
> the script is doing :O. if its having to deal w/ lots of external calls for
> example to a database or remote system, those will still be major
> bottlenecks. but as far as processing the data and running though logic,
> yes there is much performance to be had by compiling.
>
> -nathan
I don't think there was a single place where I said PHP was faster than
C, nor did I imply it.
The point I was making is simple, if you have a shitty algorithm (which
is the case for our op) expect shitty performance.
There's no doubt you will gain performance moving to C, but, if properly
designed, you have a performance that is acceptable, then why go to that
level?
--
Nick Stinemates (nick@stinemates.org)
http://nick.stinemates.org