Time taken for tests: 1.984 seconds
Total transferred: 1697100 bytes
HTML transferred: 1678700 bytes
Requests per second: 50.39 [#/sec] (mean)
Time per request: 198.438 [ms] (mean)
Time per request: 19.844 [ms] (mean, across all concurrent requests)
Transfer rate: 835.19 [Kbytes/sec] received
使用smarty缓存后:
Time taken for tests: 1.891 seconds
Total transferred: 1697100 bytes
HTML transferred: 1678700 bytes
Requests per second: 52.89 [#/sec] (mean)
Time per request: 189.063 [ms] (mean)
Time per request: 18.906 [ms] (mean, across all
Transfer rate: 876.60 [Kbytes/sec] received
没多大提高。
改造之后,但仍然先构造了smarty对象
Time taken for tests: 0.688 seconds
Total transferred: 1697100 bytes
HTML transferred: 1678700 bytes
Requests per second: 145.45 [#/sec] (mean)
Time per request: 68.750 [ms] (mean)
Time per request: 6.875 [ms] (mean, across all concurrent requests)
Transfer rate: 2410.65 [Kbytes/sec] received
显著提高啊!
把加载smarty的语句放在判断后:
Time taken for tests: 0.391 seconds
Total transferred: 1697100 bytes
HTML transferred: 1678700 bytes
Requests per second: 256.00 [#/sec] (mean)
Time per request: 39.063 [ms] (mean)
Time per request: 3.906 [ms] (mean, across all concurrent requests)
Transfer rate: 4242.75 [Kbytes/sec] received
再次大幅提高!