?
快捷搜索:  as  test  1111  test aNd 8=8  test++aNd+8=8  as++aNd+8=8  as aNd 8=8

澳門新莆京app官網:基于什么樣的理由 PHP 比其它 CGI 好呢

?

Q:基于什么樣的來由 PHP 比其它 CGI 好澳門新莆京app官網呢?有沒有對照詳細的數據可以證實 PHP 履行與其它 C澳門新莆京app官網GI 履行的效率好 ? 現在我的公司是用 C 來寫 CGI 的,假如換成 PHP,會不會對照好呢 ?沒有強而有力的依據的話,我就沒法子澳門新莆京app官網說服上面的人讓我轉成 PHP 了...

A:

我覺得"好" 要有三點

第一: 寫出來的程式的履行速率快.

第二: 碰到有大年夜量存取時的履行效能強.

第三: 程式開拓的光陰快,易掩護。

php在這三點中,雖都不必然是最好的,但也都在前茅

以下是C,PHP和Perl在速率方面的對照

我用下面的算式測試

$s=1.0;

for ($i=1;$i

然后用ab -n 10000 -c 20 http://mycgi

測試,結果

C說話用了 37.511 秒

PHP3用了 45.393 秒

PERL用了 68.418 秒

看起是C 最快沒錯,不過,和PHP3的結果沒有太大年夜

的差距。

Perl最慢

以下為測試數據

==============================================

C 說話

==============================================

Document Path: /~evan/test/gcc.cgi

Document L澳門新莆京app官網ength: 19 bytes

Concurrency Level: 20

Time taken for tests: 37.511 seconds

Complete requests: 10000

Failed requests: 0

Total transferred: 1750000 bytes

HTML transferred: 190000 bytes

Requests per second: 266.59

Transfer rate: 46.65 kb/s received

Connnection Times (ms)

min avg max

Connect: 0 30 3001

Processing: 4 40 69

Total: 4 70 3070

PHP3

==============================================

Document Path: /~evan/test/php3.php3

Document Length: 15 bytes

Concurrency Level: 20

Time taken for tests: 45.393 seconds

Complete requests: 10000

Failed requests: 0

Total transferred: 1710000 bytes

HTML transferred: 150000 bytes

Requests per second: 220.30

Transfer rate: 37.67 kb/s received

Connnection Times (ms)

min avg max

Connect: 0 34 3039

Processing: 6 53 183

Total: 6 87 3222

PERL

==============================================

Document Path: /~evan/test/perl.cgi

Document Length: 17 澳門新莆京app官網bytes

Concurrency Level: 20

Time taken for tests: 68.418 seconds

Complete requests: 10000

Failed requests: 0

Total transferred: 1730173 bytes

HTML transferred: 170017 bytes

Requests per second: 146.16

Transfer rate: 25.29 kb/s received

Connnection Times (ms)

min avg max

Connect: 0 22 3005

Processing: 9 112 323

Total: 9 134 3328

免責聲明:以上內容源自網絡,版權歸原作者所有,如有侵犯您的原創版權請告知,我們將盡快刪除相關內容。

您可能還會對下面的文章感興趣:

快三平台开户