473,386 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

performance measurement questions

I've been playing with the profiler and have been rather successful in
making my code run faster. So for my best success has been cutting a
three second CPU time run down to about 0.45 seconds.

Unfortunately, the same application seems to take about 8 to 12 seconds
real-time. I know that some of that time is lost to file IO and
external sub processes but I don't know how much.

Is there any way to change the profiler to measure elapsed time and not
CPU time?
Jul 18 '05 #1
2 1890
In article <ma************************************@python.org >,
"Eric S. Johansson" <es*@harvee.org> wrote:
I've been playing with the profiler and have been rather successful in
making my code run faster. So for my best success has been cutting a
three second CPU time run down to about 0.45 seconds.

Unfortunately, the same application seems to take about 8 to 12 seconds
real-time. I know that some of that time is lost to file IO and
external sub processes but I don't know how much.

Is there any way to change the profiler to measure elapsed time and not
CPU time?
I don't know about the profiler, but there's a couple of things you
could do to try and figure out what's going one (all of these assume a
unix-like environment):

First, use the "time" command to run your program, like this:
Roy-Smiths-Computer:unit$ time ./TargetUnit.py
........
----------------------------------------------------------------------
Ran 8 tests in 1.064s

OK

real 0m1.340s
user 0m0.960s
sys 0m0.100s


That should give you a rough idea what's going on.

If you have some ideas where the time might be spent internally, you can
use the os.times() function to gather time snapshots around areas you
suspect of being slow.
Jul 18 '05 #2
Roy Smith wrote:
In article <ma************************************@python.org >,
"Eric S. Johansson" <es*@harvee.org> wrote:

I've been playing with the profiler and have been rather successful in
making my code run faster. So for my best success has been cutting a
three second CPU time run down to about 0.45 seconds.

Unfortunately, the same application seems to take about 8 to 12 seconds
real-time. I know that some of that time is lost to file IO and
external sub processes but I don't know how much.

Is there any way to change the profiler to measure elapsed time and not
CPU time?

I don't know about the profiler, but there's a couple of things you
could do to try and figure out what's going one (all of these assume a
unix-like environment):

First, use the "time" command to run your program, like this:


unfortunately, the programs in question are CGI's and servers. I need
something networks inside the program.
If you have some ideas where the time might be spent internally, you can
use the os.times() function to gather time snapshots around areas you
suspect of being slow.


when it comes to program performance measurement, guessing usually gives
you a wrong answer since my request for profiling that measures elapsed
time.

unfortunately, I may need to do as you suggest in place time functions
throughout the code.

---eric

Jul 18 '05 #3

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

Similar topics

0
by: Eric S. Johansson | last post by:
more questions about performance measurements in python. I solve the problems I had with shelf by not using it. I'm doing a direct pickle to and from file of an entire dictionary. That knocked off...
0
by: Alex Vinokur | last post by:
=================================== ------------- Sorting ------------- Comparative performance measurement =================================== Testsuite : Comparing Function Objects to...
4
by: zzfreddybb | last post by:
We are using HP aCC compiler on a HP Itanium box ( 11.23) We are having some severe performance hits using exception handling ( try/catch ) scenarios. The online aCC documentation says: HP...
8
by: Sebastian Werner | last post by:
Howdy, I currently develop the javascript toolkit qooxdoo (http://qooxdoo.sourceforge.net), some of you heard it already. We have discovered a slowdown on Internet Explorers performance when...
6
by: Alex Vinokur | last post by:
Here are results of comparative performance tests carried out using the same compiler (gcc 3.2) in different environments (CYGWIN, MINGW, DJGPP) on Windows 2000 Professional. The following...
4
by: Martin | last post by:
I am using graphics as backgrounds for forms,buttons,labels etc. The question is: is it faster to load all graphics from files on app start or to use it embeded (places in editor during design)....
2
by: Jeff S | last post by:
I'm looking for guidance (tutorials, backgrounders, tips, or otherwise) on measuring the performance of ASP.NET applications. I'm specifically interested in acquiring the capability of generating...
1
by: Ted | last post by:
I have cross posted this to comp.lang.c++ and to sci.math.num- analysis in the belief that the topic is of interest to some in both groups. I am building my toolkit, in support of my efforts in...
12
by: webdeveloper | last post by:
Hi (Please advise me if I'm in the wrong newsgroup.) Users claim that our application is slow. We are using ASP.NET with VB.NET (Visual Studio 2005) and SQL-Server 2000 (on a different server)....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.