473,396 Members | 1,799 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,396 software developers and data experts.

Profiling with hotshot and wall clock time

Hi!

I'm trying to profile an application that I believe is blocking on I/O
for a significant amount of time. In trying to dig down where this
happens, I profiled the application with hotshot. The results are not
really usable however as it seems to display the amount of CPU time
which for my application is much lower than the total run time.

Is possible to use hotshot with wall clock time, i.e. is it possible to
have the code fragment below show one second as opposed to zero? The old
profiler seems to have functionality choosing a timer function but it
crashed on my code.

<cut>
import os
import time
import hotshot
import hotshot.stats
import tempfile

def profile(call, *args):
"""Profile function `call', invoked with `args'."""
fd, fprof = tempfile.mkstemp()
os.close(fd)
profiler = hotshot.Profile(fprof)
profiler.runcall(call, *args)
profiler.close()
stats = hotshot.stats.load(fprof)
stats.strip_dirs().sort_stats('time').print_stats( )
os.remove(fprof)

profile(time.sleep, 1)
</cut>

Regards,
Geert Jansen
Nov 24 '05 #1
1 1743
Geert Jansen <ge***@boskant.nl> writes on Thu, 24 Nov 2005 21:33:03 +0100:
...
Is possible to use hotshot with wall clock time, i.e. is it possible
to have the code fragment below show one second as opposed to zero?
The old profiler seems to have functionality choosing a timer function
but it crashed on my code.


I do not know whether it is possible with "hotshop" but it is
with "profile". Depending on how large the waiting time it,
"profile" might be adequate to analyse the problem.
Dieter
Nov 26 '05 #2

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

Similar topics

6
by: KefX | last post by:
Hi guys! I'm still a bit of a Python newbie, but regardless I decided to embed Python into a plugin for a freeware (closed-source) Windows music program called Jeskola Buzz. (Man, I can't believe...
4
by: KefX | last post by:
Hey...as for what I'm doing with Python, look at my post "Strange Hotshot problem". To make a long story short, I'm embedding Python in order to write a plugin to a freeware music program; the...
0
by: Irmen de Jong | last post by:
Hi, when using the hotshot profiler, I can see no difference in the measurement of a function that is busy eating CPU cycles, and a function that is blocking/waiting on IO (or sleeping)... For...
0
by: Rodrigo Daunaravicius | last post by:
I'm having trouble understanding hotshot's results. It's the first time I use a profiler. I'm trying to profile a loop that takes almost six hours (~21000 seconds) to execute in production. The...
0
by: Irmen de Jong | last post by:
Okay I tried some profiling, but am uncertain about the results I'm getting. They confuse the hell out of me. I have a test program (see below) that essentially has two loops that get called...
13
by: Peter Hansen | last post by:
I would like to determine the "actual" elapsed time of an operation which could take place during a time change, in a platform-independent manner (at least across Linux/Windows machines). Using...
6
by: cournape | last post by:
Hi there, I have some scientific application written in python. There is a good deal of list processing, but also some "simple" computation such as basic linear algebra involved. I would like to...
12
by: aegis | last post by:
What is wall clock time? the standard doesn't define it but I see its use in past posts on clc. -- aegis
0
by: Gregory Piñero | last post by:
Would someone mind giving me a quick explanation on what this is telling me? How much is 201 CPU seconds? Watching the clock the run seems to take 7 seconds all the way from clicking on the batch...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
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
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...

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.