荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: Pazu (不可一世的眼睛), 信区: Database
标  题: [转载] PHP VS ASP
发信站: BBS 荔园晨风站 (Mon Mar 27 13:10:01 2000), 转信

【 以下文字转载自 Linux 讨论区 】
【 原文由 Pazu 所发表 】
PHP 4.0 pre-alpha vs. ASP
Many people have asked us to post benchmarks that compare PHP 4.0 and ASP.
We haven't done so until now, mainly because neither of us had any ASP
experience and we didn't really know how to port the scripts to ASP.

Thanks to Curt W. Zirzow, who ported the QuickSort script from ASP to PHP,
we learnt enough ASP to port the Mandelbrot script as well. We bring you
these two benchmarks, in addition to one other trivial empty loop benchmark.

All benchmarks were conducted on a P2-233 box with 128MB RAM, running Windows
 NT Server/SP4 with IIS 4.0. PHP was compiled as an ISAPI module. The ASP
language used was VBScript.


--------------------------------------------------------------------------------


Simple Loop

We'd start with a fairly stupid yet interesting benchmark, benchmarking the
speed of an empty loop (i.e., a loop that simply increments i from 0 to a
certain number).

Simple Loop (10 million iterations)
Platform ASP PHP/ PHP/ + optimizer
Timing 44 seconds 43 seconds 12.5 seconds
Improvement  0% 2% 352% (344% over  without the optimizer)

Quick Sort

Quicksort is one of the most popular sorting algorithms in existance. While
since the usort() function was introduced in PHP 3.0.3, it's not really
necessary to implement the algorithm itself in PHP, it still makes a good
example for a real-world
algorit.m.

The code is a slightly modified version of David Sklar's quicksort
implementation, taken from http://px.sklar.com/.

Quicksorting 200 elements, 20 times
Platform ASP PHP/ PHP/ + optimizer
Timing 10 seconds 44 seconds 6 seconds
Improvement  0% -440% 66% (733% over  without the optimizer)

Ok, you may think this calls for an explanation. How come that the freeware
PHP is much slower than ASP? The facts is, as you'd see in the next benchmark,
that it isn't. It just so happens that quicksort has all of the elements that
signficantly
benefit from the optimizer all brought into one script. Since your average
script won't have thousands of short cycle function calls and array shuffling,
 you shouldn't really worry about this script.




Mandelbrot Generator

Granted, this isn't exactly your every-day use of PHP, but like the Quicksort
 test, it provides a very good real-world example of 's performance.

The code was contributed by Michael Kohn (author of asp2php). You can also
see the output here (it's run by PHP 3.0, so it may take a while :).

Simple Mandelbrot (executed 10 times in a row)
Platform ASP PHP/ PHP/ + optimizer
Timing 14 seconds 12.5 seconds 6 seconds
Improvement  0% 12% 233% (208% over  without the optimizer)

--
☆ 来源:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: bbs@192.168.0.189]
--
※ 修改:·Pazu 於 Mar 27 13:38:11 修改本文·[FROM: 192.168.0.189]
※ 转载:·BBS 荔园晨风站 bbs.szu.edu.cn·[FROM: 192.168.0.189]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店