My favorites | Sign in
Project Home Wiki
Search
for
tmphp_benchmark  
One-sentence summary of this page.
性能测试
Updated Dec 24, 2009 by heiyeluren@gmail.com

TMPHP 性能对比测试

测试环境

  • ThinkPad T400
  • Inter Core 2 Duo CPU/P8400/2.26GHz
  • 2GB DDR RAM
  • Windows 7 32 bit OS
  • Apache 2.2.12 / PHP 5.3.0 / MySQL 5.1.37-log

测试对比

  • TMPHP-1.0.0 大概是原生PHP 25% 左右的性能
  • TMPHP-1.0.0 大概是 Zend Framework (暂无数据)
  • TMPHP-1.0.0 大概是 Symfony (暂无数据)

TMPHP-1.0.0 性能

  • 测试代码

  • class indexController extends TM_Controller
    {
    	/**
    	 * 性能测试Aciton
    	 *
    	 * 访问URL:http://localhost/?c=index&a=time
    	 *
    	 * @return void
    	 */	
    	public function timeAction(){
    		echo time();
    	}
    }
  • 测试过程

  • ab -n10000 -c200 "http://127.0.0.1/index.php?c=index&a=time"
测试输出数据:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:        Apache/2.2.12
Server Hostname:        127.0.0.1
Server Port:            80

Document Path:          /index.php?c=index&a=time
Document Length:        10 bytes

Concurrency Level:      200
Time taken for tests:   45.521 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      2500000 bytes
HTML transferred:       100000 bytes
Requests per second:    219.68 [#/sec] (mean)
Time per request:       910.418 [ms] (mean)
Time per request:       4.552 [ms] (mean, across all concurrent requests)
Transfer rate:          53.63 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   2.0      0      16
Processing:   140  902  72.2    905    1170
Waiting:      140  901  72.2    905    1170
Total:        140  902  72.2    905    1170

Percentage of the requests served within a certain time (ms)
  50%    905
  66%    920
  75%    936
  80%    936
  90%    967
  95%    983
  98%   1014
  99%   1045
 100%   1170 (longest request)
测试结果: 每秒QPS:219.68 #/sec

原生PHP性能

  • 测试代码

  • echo time();
  • 测试过程

  • ab -n10000 -c200 "http://127.0.0.1/time.php"
测试输出数据:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:        Apache/2.2.12
Server Hostname:        127.0.0.1
Server Port:            80

Document Path:          /time.php
Document Length:        10 bytes

Concurrency Level:      200
Time taken for tests:   8.752 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      2500000 bytes
HTML transferred:       100000 bytes
Requests per second:    1142.65 [#/sec] (mean)
Time per request:       175.032 [ms] (mean)
Time per request:       0.875 [ms] (mean, across all concurrent requests)
Transfer rate:          278.97 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   2.0      0      16
Processing:    47  173  15.7    172     218
Waiting:       47  172  15.7    172     218
Total:         47  173  15.6    172     218

Percentage of the requests served within a certain time (ms)
  50%    172
  66%    172
  75%    172
  80%    187
  90%    187
  95%    203
  98%    203
  99%    203
 100%    218 (longest request)
测试结果: 每秒QPS:1142.65 #/sec
Comment by 1001c...@gmail.com, Feb 27, 2011

比原生的PHP还要快?????

Comment by thi...@gmail.com, Jun 23, 2011

慢太多了


Sign in to add a comment
Powered by Google Project Hosting