However, when you use a database that is on a different computer than the WEB server, caching a database result set is usually a good idea. However, determining the best caching strategy based on your situation is a challenge. For example, for
1. Using single quotes to contain strings is faster than double quotes to contain strings. Because PHP searches for variables in a string enclosed in double quotes, single quotes do not.
2. If you can define the method of a class as static, try to
1, can use file_get_contents instead of file, fopen, feof, Fgets, and other series of methods, as far as possible with file_get_contents, because his efficiency is much higher! But pay attention to file_get_contents in opening a URL file when the
Small series in front said to realize Lnmp (linux+nginx+mysql+php), in this blog small make up will how to realize Lnmp, because Nginx strong, now more and more enterprises are keen on the LNMP architecture, so small make up to simply realize this
First, performance analysis-related functions and commands 1.1, time measurement functions usually we often use the Times () function, but the return is the number of seconds, for a piece of code internal performance analysis, to the second
Php-fpm.confLogIf you don't, you can turn off logging to improve performance.IniSession.save_pathIf your PHP program uses session dialog, you can set the session storage location to/DEV/SHM,/DEV/SHM is the Linux system unique TMPFS file system, is
In many cases, we often encounter performance bottlenecks. The bottleneck is not terrible. What's terrible is that you don't know where the bottleneck is. In practice, many friends do not know how to solve the problem. Let me talk about a tool I
XHProf is a function-level PHP layered analyzer developed by FaceBook. The data collection part is a C-based PHP extension, and the analysis report is a series of PHP-based HTML navigation pages. XHProf can count the number of calls to each function,
Use single quotes instead of double quotes to include strings, which is faster. Because PHP will search for variables in strings enclosed by double quotes, but not in single quotes. Note: Only ECHO can do this, it is a "function" that can treat
This article describes how to import a large amount of data to mysql in php to optimize the performance of mysql by optimizing SQL statements.
This article describes how to import a large amount of data to mysql in php to optimize the performance of
The following summarizes the 18 PHP code can be done in writing optimization habits, in order to maximize the speed of the implementation of PHP code!
(1) uses static static Method 4 times times faster than normal method(2) Echo output faster than
1. Do not copy variables randomly
Sometimes in order to make the PHP code more neat, some novice PHP (including me) will copy the predefined variables into a shorter name of the variable, in fact, the result is an increase in memory consumption,
PHP can be a lot of detail to improve the efficiency of execution, the following is a summary.
Statically called members must be defined as static (PHP5 only)
PHP 5 introduces the concept of static members, which is consistent with the internal
Xhprof is an open source PHP lightweight performance analysis tool for Facebook, similar to Xdebug, but with lower performance overhead, can also be used in production environments or controlled by program switches. Overall is a good tool, the
Building the client
Now, you have targeted ORDERS and Order_items
Table creates a registration, we'll look at how the client application that accesses the orders stored in these tables and their order items uses change notifications. To do this,
As we all know, the results of cached database queries can significantly shorten script execution time and minimize the load on the database server. If the data to be processed is essentially static, the technique will be very effective. This is
Starting from PHP5.1, PHP provides an interface for users to select a distribution method for ZendVM execution. in my previous articles, I also mentioned this. when the Zend virtual machine is running, the opcode of each opline in the op_array
Ask for guidance from the PHP experts. today, I participated in a Coding & nbsp; Dojo (programming Dojo). Afterwards, I had some doubts and hoped that the experts could provide guidance. I am a PHPer and now I am in an e-commerce company. I am a big
This article describes how to optimize the performance of importing a large amount of data into mysql using php. it is of great practical value to improve the performance of mysql by optimizing SQL statements, for more information about how to
XCache Introduction The principles and functions of the PHP accelerator (see PHP-FPM Server for Lamp architecture) are described earlier, and XCache, as one of the most widely used PHP accelerators, performs better than earlier Eaccelerator
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.