Re: [PHP] PHP console script vs C/C++/C#
- Date: Sat, 19 Apr 2008 13:08:54 +0200
- From: Per Jessen <per@xxxxxxxxxxxx>
- Subject: Re: [PHP] PHP console script vs C/C++/C#
Nathan Nobbe wrote:
> On Fri, Apr 18, 2008 at 11:25 AM, Nick Stinemates
> <nick@xxxxxxxxxxxxxx> 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.
No, that is actually a very accurate statement. An algorithm will
perform equally well regardless of the language chosen. How well the
actual implementation performs overall is a separate issue. The
performance or rather efficiency of an algorithm is usually expressed
in the big-O notation, e.g. O(n), O(log(n)) etc.
A linear search is O(n), a quick sort is O(nlog(n)) (on average) - both
perform equally bad or equally well regardless of which language you
choose to implement them in.
> 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.
An algorithm doesn't have external dependencies - but implementations
might.
/Per Jessen, Zürich
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php