A little summary of optimizing PHP performance

Source: Internet
Author: User
Tags zend

Shown as 100 concurrent, request 1000 times Destination Address

To test

The most important two parameters: Requests per second: Receive requests per second, where 101 requests per second

Time per request: How long a request takes, here is 9 milliseconds

The larger the first parameter, the better, the smaller the second parameter, the better.

Optimization method of language-level performance optimization 1

PHP Code Execution Flow:

PHP code through the Zend Engine line by scan, become the Zend engine can understand the syntax, transcoding parsing into opcodes, after execution output

If you use the built-in function more quickly, the time will be much faster in scanning and understanding, opcodes will be less, execution will be fast.

Optimization method of language-level performance optimization 2

optimization method of language-level performance Optimization 3

Test

The time PHP file name can be executed with a focus on the user value, which is 24 milliseconds

optimization method of language-level performance Optimization 4

Optimization method of language-level performance optimization 5

Optimization method of language-level performance optimization 6

Optimization method of language-level performance optimization 7

It's better to change it.

optimization method of language-level performance optimization 8

Optimization method of language-level performance optimization 9

Optimization of peripheral problems of optimizing method

Optimization method of peripheral problems performance Optimization 1

Common PHP Scenario Overhead order: Read/write memory << read/write database (read and write HDD) < read and write disk < read and write network data (stealth cost: Network latency)

Optimization method of peripheral problems performance optimization 2

optimization method of peripheral problems performance Optimization 3

Optimization method of peripheral problems performance Optimization 4

Optimization method of peripheral problems performance Optimization 5

Parallel change serial

Optimization method of peripheral problems performance optimization 6

Xhprof tools to analyze PHP performance

This command checks to see if the software is installed

installation and use of XHPROF tools : http://www.cnblogs.com/bluefrog/archive/2012/03/01/2374922.html

Use diagram:

PHP Performance Bottlenecks-The ultimate solution

A little summary of optimizing PHP performance

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.