473,794 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1907
In article <ma************ *************** *********@pytho n.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************ *************** *********@pytho n.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
1397
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 a good third of my CPU time. there was another big hit that that was quick and easy. I went from approximately 3.5 seconds down to .5 seconds CPU time. The problem is, from hitting the submit button to new display, it is taking approximately 23...
0
2671
by: Alex Vinokur | last post by:
=================================== ------------- Sorting ------------- Comparative performance measurement =================================== Testsuite : Comparing Function Objects to Function Pointers Source : Technical Report on C++ Performance Tool : The C/C++ Program Perfometer (Version 2.8.1-1.19-Beta) * http://sourceforge.net/projects/cpp-perfometer/
4
3138
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 aC++ exception handling has no significant performance impact at compile-time or run-time. We have not found this to be the case at all.
8
2053
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 creating objects with some data and store them in a global object registry. It take some time to get this example extracted from our codebase. The attached file (take a look at it please) shows the exact problem. The time for each object increases...
6
5225
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 C-functions were tested : * strcpy * memcpy * memmove
4
3363
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). Reason for my question is that application has 5mb, while without graphics it has cca 400kb. Graphic files (bmps) take about 200kb (in program, they are repeated many times, ie almost all labels (around 200) have same background image)). Also,...
2
1624
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 objective data that quantifies the effects of performance tuning efforts (e.g., performance measures before and after implementing caching). I want to be able to demonstrate cases where performance tuning efforts resulted in measurably faster...
1
2390
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 producing high performance C++ code; code that is provably correct. The issue here is orthogonal to the question of expression templates, which at present seem to me to be relatively simple.
12
2762
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). On the main page we have a standard Intersoft WebGrid and another control for the menu (from ComponentArt I think). When doing a search on that page, it takes overall about 6.5 seconds, even if the search didn't return anything. We have...
0
9672
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
9519
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
10435
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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...
1
7538
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
5436
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
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.