473,811 Members | 2,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Measuring performance of PHP

I'm writing PHP Web sites that are database driven with mysql.

I'm looking for ways to measure the performance (speed) of my php code, so
that I can find ways to write the fastest php code. Any suggestions?

Nick
Jul 17 '05 #1
6 2332
Mudge wrote:
I'm looking for ways to measure the performance (speed) of my php code, so
that I can find ways to write the fastest php code. Any suggestions?


Use microtime() function at the beginning of your code and save the
result into variable. Then do the same at the end and calculate the
difference.
Jul 17 '05 #2
"Mudge" <ma******@hotma il.com> wrote in message
news:hklRc.2671 53$XM6.192050@a ttbi_s53...
I'm writing PHP Web sites that are database driven with mysql.

I'm looking for ways to measure the performance (speed) of my php code, so
that I can find ways to write the fastest php code. Any suggestions?

Nick


Load up the database with lots of test data and run through the site with
your browser. Perceived performance is what's important. After all, if an
improvement can only be detected by a test tool, what is the point?
Jul 17 '05 #3
On 2004-08-08, Mudge wrote:
I'm writing PHP Web sites that are database driven with mysql.

I'm looking for ways to measure the performance (speed) of my php code, so
that I can find ways to write the fastest php code. Any suggestions?

Nick


Check the PHP manual section for microtime, especially the example code
and user comments:
http://www.php.net/microtime

--
Mike Peters
mike [-AT-] ice2o [-DOT-] com
http://www.ice2o.com
Jul 17 '05 #4
"Mudge" wrote:
I’m writing PHP Web sites that are database driven with mysql.

I’m looking for ways to measure the performance (speed) of my
php code, so
that I can find ways to write the fastest php code. Any suggestions?
Nick


Use a PHP timing class. All done 4 u.
http://www.phpbuilder.com/columns/akent20000926.php3

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-Measurin...ict137571.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=459814
Jul 17 '05 #5
Chung Leong wrote:
Load up the database with lots of test data and run through the site with
your browser. Perceived performance is what's important. After all, if an
improvement can only be detected by a test tool, what is the point?


Nothing if you have only one user. But if you got 10^X users, then wait
time for each user will increase, because they have to wait for other
viewers first.

For example, if it takes 1 second for the php to do it all, and we have
600 viewers. Assuming processor time will be shared equally for all,
then they all have to wait 10 minutes before they can see the page. If
time will be shared unequally, then first person might get the page in 1
second, but the last one would have to wait 10 minutes.

And now, if you can speed up the page into 0,5 seconds. Doesn't look
much, but viewers will see the page 5 minutes faster assuming we have
the same amount of viewers.
Jul 17 '05 #6
Mudge wrote:
I'm writing PHP Web sites that are database driven with mysql.

I'm looking for ways to measure the performance (speed) of my php code, so
that I can find ways to write the fastest php code. Any suggestions?

Nick


I think you should check out the xdebug extension created by Derick Rethans,
available at http://www.xdebug.org

It's a great way to measure performance, and will help you debug your PHP apps.

/p

--
http://www.pergustafsson.com/
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
843
by: Silent Ocean | last post by:
Do we have any tools available to measure the performance of a dot net c# application in multiuser scenario??
0
1447
by: Jack | last post by:
I am trying to diagnose some partitioned db performance problems and am trying to figure out how to measure how much time is spent on communicating between the nodes. I'm seeing long execution times, but short CPU times. I know how to measure the IO times, but can't figure out how to measure the network times involved. This is running on a Linux cluster.
1
2778
by: Kovan Akrei | last post by:
Hi, I have a multithreaded console program package. I would like to check it's peak memory usage. When I check the cmd windows process in task manager I allayes get something like 6 or 7 Mb, but I know that the program uses more than that My questions is: Are there any utilities that tells how much memory (max memory) a C# program uses during its execution? How about classes in .Net class library?
6
1466
by: James dean | last post by:
I am comparing performance of my own application with another microsoft product. Is there first of all any s/w that could measure the performance of a running application like Ms publisher.....would be great if their was. I would at least like s/w to measure the performance of my own C# application. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
1105
by: Guadala Harry | last post by:
Just wondering if/how it is possible to measure how much memory (physical and/or virtual) is used by objects stored in 1. Cache object 2. Application State 3. Session States (across all current sessions of an application) 4. Output Cache (Page/Control caching) Thanks
1
2414
by: Bill Cohagan | last post by:
We are attempting to convert an already existing application over to using multiple worker processes; thus we need to store state via session state server rather than in process. Since this app previously used in process state there was little back pressure against storing objects in the session. Now we're paying the price because serialization sucks in referenced objects resulting in possibly huge state storage and serialize/deserialize...
5
3699
by: Logu Krishnan | last post by:
Hi I'm trying to profile my application and do sizing of the app. is there a way to size the session ?? -- Logu Krishnan
2
1295
by: tbh | last post by:
cpu load increased on our web servers unexpectedly after a recent, fairly routine "release change" (which is to say, we changed a bunch of our scripts and libraries in one fell swoop). i can back off to the previous release, but it is typically quite hard to simulate live load on test systems, so in general it would be good to know in a live setting where this additional cpu drain is coming from. i know which application is using the...
9
3320
by: Ross | last post by:
I'm a newbie at this, and have searched a lot but can't find something that seems appropriate for measuring a recurring elapsed time. Creating an object with: var mydate = new Date(); seems clear, as is creating a second: nowTime = new Date(); and getting a difference between the two. My quesiton is what if you have many, maybe thousands of intervals you wish to measure? Should I do: nowTime = new Date(); with every pass of a...
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10137
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9211
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5564
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4352
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.