Re: PHP console script vs C/C++/C#
| From: | Nathan Nobbe | Date: | Fri, 18 Apr 2008 18:55:59 +0000 |
| Subject: | Re: PHP console script vs C/C++/C# | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-273265@lists.php.net to get a copy of this message | ||
On Fri, Apr 18, 2008 at 11:25 AM, Nick Stinemates <nick@stinemates.org>
wrote:
> I don't think there was a single place where I said PHP was faster than
> C, nor did I imply it.
>
> > Depends. Shitty algorithms are shitty, regardless of language
> > implementation.
implies that the same algorithm in different languages will not perform
differently. thats innacurate. the same algorithm w/o external
dependencies, such as db calls, or calls to remote systems will run faster
in java / c / c++ and others than it will in php.
The point I was making is simple, if you have a shitty algorithm (which
> is the case for our op) expect shitty performance.
>
right, and i agree with that, but its a different point. if op moved the
same shitty algorithm to c it would be faster.
> 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?
obviously, it makes perfect sense to clean up php code (esp if its written
poorly) prior to porting to a low-level language. i am in total agreement
with you there. however, the point i was making was, if the same crap was
ported to a compiled language, it would be faster (barring external calls
that for example go over the network [which even then it would likely still
be a little faster]).
-nathan