Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #4055 > unrolled thread

Perl or PHP?

Started byVictor Porton <porton@narod.ru>
First post2013-12-28 17:49 +0200
Last post2013-12-28 12:26 -0800
Articles 9 — 4 participants

Back to article view | Back to comp.programming


Contents

  Perl or PHP? Victor Porton <porton@narod.ru> - 2013-12-28 17:49 +0200
    Re: Perl or PHP? Victor Porton <porton@narod.ru> - 2013-12-28 17:51 +0200
    Re: Perl or PHP? Luuk <luuk@invalid.lan> - 2013-12-28 17:03 +0100
      Re: Perl or PHP? Victor Porton <porton@narod.ru> - 2013-12-28 18:11 +0200
        Re: Perl or PHP? Luuk <luuk@invalid.lan> - 2013-12-28 17:18 +0100
          Re: Perl or PHP? "BartC" <bc@freeuk.com> - 2013-12-28 22:13 +0000
            Re: Perl or PHP? Luuk <luuk@invalid.lan> - 2013-12-29 17:29 +0100
    Re: Perl or PHP? Victor Porton <porton@narod.ru> - 2013-12-28 20:40 +0200
      Re: Perl or PHP? Öö Tiib <ootiib@hot.ee> - 2013-12-28 12:26 -0800

#4055 — Perl or PHP?

FromVictor Porton <porton@narod.ru>
Date2013-12-28 17:49 +0200
SubjectPerl or PHP?
Message-ID<l9mruq$pn8$1@speranza.aioe.org>
I consider to make a startup (a Web site with many MySQL InnoDB queries on 
each page) and hope to sell it to Google.

Perl or PHP? Please be argumented.

First, whose performance is greater: Perl or PHP?

-- 
Victor Porton - http://portonvictor.org

[toc] | [next] | [standalone]


#4056

FromVictor Porton <porton@narod.ru>
Date2013-12-28 17:51 +0200
Message-ID<l9ms25$pn8$2@speranza.aioe.org>
In reply to#4055
Victor Porton wrote:

> I consider to make a startup (a Web site with many MySQL InnoDB queries on
> each page) and hope to sell it to Google.
> 
> Perl or PHP? Please be argumented.
> 
> First, whose performance is greater: Perl or PHP?

Moreover, is it OK (for performance consideration) to use a framework such 
as Yii?

-- 
Victor Porton - http://portonvictor.org

[toc] | [prev] | [next] | [standalone]


#4057

FromLuuk <luuk@invalid.lan>
Date2013-12-28 17:03 +0100
Message-ID<db93pa-d0p.ln1@luuk.invalid.lan>
In reply to#4055
On 28-12-2013 16:49, Victor Porton wrote:
> I consider to make a startup (a Web site with many MySQL InnoDB queries on
> each page) and hope to sell it to Google.
>
> Perl or PHP? Please be argumented.
>
> First, whose performance is greater: Perl or PHP?
>

~/temp> time ./test.pl >test.tmp

real    0m0.004s
user    0m0.000s
sys     0m0.004s
~/temp> time ./test.php >test.tmp

real    0m0.042s
user    0m0.026s
sys     0m0.016s
luuk@opensuse:~/temp>


But the question of course is, what are your comparing?

;-)

[toc] | [prev] | [next] | [standalone]


#4058

FromVictor Porton <porton@narod.ru>
Date2013-12-28 18:11 +0200
Message-ID<l9mt81$sqg$1@speranza.aioe.org>
In reply to#4057
Luuk wrote:

> On 28-12-2013 16:49, Victor Porton wrote:
>> I consider to make a startup (a Web site with many MySQL InnoDB queries
>> on each page) and hope to sell it to Google.
>>
>> Perl or PHP? Please be argumented.
>>
>> First, whose performance is greater: Perl or PHP?
>>
> 
> ~/temp> time ./test.pl >test.tmp
> 
> real    0m0.004s
> user    0m0.000s
> sys     0m0.004s
> ~/temp> time ./test.php >test.tmp
> 
> real    0m0.042s
> user    0m0.026s
> sys     0m0.016s
> luuk@opensuse:~/temp>

Could you disclose the content of files test.pl and test.php?

> But the question of course is, what are your comparing?
> 
> ;-)

-- 
Victor Porton - http://portonvictor.org

[toc] | [prev] | [next] | [standalone]


#4059

FromLuuk <luuk@invalid.lan>
Date2013-12-28 17:18 +0100
Message-ID<98a3pa-0sq.ln1@luuk.invalid.lan>
In reply to#4058
On 28-12-2013 17:11, Victor Porton wrote:
> Luuk wrote:
>
>> On 28-12-2013 16:49, Victor Porton wrote:
>>> I consider to make a startup (a Web site with many MySQL InnoDB queries
>>> on each page) and hope to sell it to Google.
>>>
>>> Perl or PHP? Please be argumented.
>>>
>>> First, whose performance is greater: Perl or PHP?
>>>
>>
>> ~/temp> time ./test.pl >test.tmp
>>
>> real    0m0.004s
>> user    0m0.000s
>> sys     0m0.004s
>> ~/temp> time ./test.php >test.tmp
>>
>> real    0m0.042s
>> user    0m0.026s
>> sys     0m0.016s
>> luuk@opensuse:~/temp>
>
> Could you disclose the content of files test.pl and test.php?
>
>> But the question of course is, what are your comparing?
>>
>> ;-)
>

   1 #!/usr/bin/perl
   2
   3 for ($count = 1000; $count >= 1; $count--) {
   4                 print "$count ";
   5                  }


and

   1 #!/usr/bin/php
   2
   3 <?php
   4 for ($f=1000; $f>=1; $f--)
   5         echo "$f ";

[toc] | [prev] | [next] | [standalone]


#4062

From"BartC" <bc@freeuk.com>
Date2013-12-28 22:13 +0000
Message-ID<v2Ivu.1028$v04.766@fx28.am4>
In reply to#4059
"Luuk" <luuk@invalid.lan> wrote in message
news:98a3pa-0sq.ln1@luuk.invalid.lan...
> On 28-12-2013 17:11, Victor Porton wrote:

>> Could you disclose the content of files test.pl and test.php?
>>
>>> But the question of course is, what are your comparing?
>>>
>>> ;-)
>>
>
>   1 #!/usr/bin/perl
>   2
>   3 for ($count = 1000; $count >= 1; $count--) {
>   4                 print "$count ";
>   5                  }
>
>
> and
>
>   1 #!/usr/bin/php
>   2
>   3 <?php
>   4 for ($f=1000; $f>=1; $f--)
>   5         echo "$f ";

So you're mainly testing I/O rather than the language: which depends on the
commands that are used for output in the language, how they are implemented,
how the console is driven, the console implementation code, the kind of
display, etc.

Changing your tests a little so that the loops increment a variable, and
putting the output at the end, makes PHP twice as fast as Perl (on the same
setup which had PHP seven times slower than Perl using your tests.) Eg:

$a=0;
for ($count = 10000000; $count >= 1; $count--) {
                $a=$a+1;
etc.

Still a lousy benchmark, but at least it avoids I/O which is highly 
misleading.


-- 
Bartc 

[toc] | [prev] | [next] | [standalone]


#4063

FromLuuk <luuk@invalid.lan>
Date2013-12-29 17:29 +0100
Message-ID<78v5pa-34i.ln1@luuk.invalid.lan>
In reply to#4062
On 28-12-2013 23:13, BartC wrote:
> "Luuk" <luuk@invalid.lan> wrote in message
> news:98a3pa-0sq.ln1@luuk.invalid.lan...
>> On 28-12-2013 17:11, Victor Porton wrote:
>
>>> Could you disclose the content of files test.pl and test.php?
>>>
>>>> But the question of course is, what are your comparing?
>>>>
>>>> ;-)
>>>
>>
>>   1 #!/usr/bin/perl
>>   2
>>   3 for ($count = 1000; $count >= 1; $count--) {
>>   4                 print "$count ";
>>   5                  }
>>
>>
>> and
>>
>>   1 #!/usr/bin/php
>>   2
>>   3 <?php
>>   4 for ($f=1000; $f>=1; $f--)
>>   5         echo "$f ";
>
> So you're mainly testing I/O rather than the language: which depends on the
> commands that are used for output in the language, how they are
> implemented,
> how the console is driven, the console implementation code, the kind of
> display, etc.
>
> Changing your tests a little so that the loops increment a variable, and
> putting the output at the end, makes PHP twice as fast as Perl (on the same
> setup which had PHP seven times slower than Perl using your tests.) Eg:
>
> $a=0;
> for ($count = 10000000; $count >= 1; $count--) {
>                 $a=$a+1;
> etc.
>
> Still a lousy benchmark, but at least it avoids I/O which is highly
> misleading.
>
>

thats why i said:
what are your comparing?

;-)

The starting point of this thread was wrong.

OP should have investigated the strong, an weak points of both choices, 
in stead of yust focussing on 'performance'

[toc] | [prev] | [next] | [standalone]


#4060

FromVictor Porton <porton@narod.ru>
Date2013-12-28 20:40 +0200
Message-ID<l9n5ue$inr$1@speranza.aioe.org>
In reply to#4055
Victor Porton wrote:
> I consider to make a startup (a Web site with many MySQL InnoDB queries on
> each page) and hope to sell it to Google.
> 
> Perl or PHP? Please be argumented.
> 
> First, whose performance is greater: Perl or PHP?

I've abandoned this project. Maybe it may bring me millions of dollars (or 
maybe not), but not this is important for me, for me is more important that 
I would need to pay something like $100/month to start the project. Paying 
my monthly bills now is more important for me than a possible million in the 
future.

Well, if anyone wants to invest some hundreds dollars into my project, 
please contact me.

-- 
Victor Porton - http://portonvictor.org

[toc] | [prev] | [next] | [standalone]


#4061

FromÖö Tiib <ootiib@hot.ee>
Date2013-12-28 12:26 -0800
Message-ID<8df81b64-d342-44b4-9e07-8edd7624c96e@googlegroups.com>
In reply to#4060
On Saturday, 28 December 2013 20:40:09 UTC+2, Victor Porton  wrote:
> Victor Porton wrote:
> > I consider to make a startup (a Web site with many MySQL InnoDB queries on
> > each page) and hope to sell it to Google.
> > 
> > Perl or PHP? Please be argumented.
> > 
> > First, whose performance is greater: Perl or PHP?
> 
> I've abandoned this project. Maybe it may bring me millions of dollars (or 
> maybe not), but not this is important for me, for me is more important that 
> I would need to pay something like $100/month to start the project. Paying 
> my monthly bills now is more important for me than a possible million in the 
> future.
> 
> Well, if anyone wants to invest some hundreds dollars into my project, 
> please contact me.

Why?  What you have demonstrated: odd business plan, newbie's question,
lack of money and your plans change on hourly basis. Had you used
smiley then I would consider it as a decent joke about current IT bubble "businessmen".

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web