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

removing data from the profiler Stats object

Hi,
I have just started using the Python profiler and cannot get
the output I want. Once I have profiled a piece of code and saved the
data to a file, I can load it in using the pstats module. I have found
that 96% of my program's time is spent in three object methods (and their
callees) but want to know what the other 4% is.

I can do this:

p = pstats.Stats('profile.data')
p.print_callees('expensive_method1')
p.print_callees('expensive_method2')
p.print_callees('expensive_method3')

Which makes me think that the data must be held in a tree of some sort,
but what I want is to prune those branches from the tree and see the rest
of the data:

p.print_stats(without expensive_method[123])

I suppose I could roughly get this data by changing the three expensive
methods to immediately return some dummy data, but thought it ought to be
possible to interrogate the Stats object to get the answer.

The other 4% may also include calls to the same functions as in the 96% so
it is not just a matter of looking at the data for particular functions.
I know it seems silly to be chasing after 4% of the profile but it is
important in this case.

Thanks.

Stephen Phillips.
Jul 18 '05 #1
0 1132

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

Similar topics

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...
1
by: Mac | last post by:
I'm writing a bunch of algorithms in Python for solving a certain class of problems, and I was interested in doing some comparisons between them and would like to collect various high-level runtime...
9
by: Franco Gustavo | last post by:
Hi, All What's is the best .net profiler for Debug an application. I have to buy one but I don't know which one!! I tried some of them like Borland and AQTime. My big problem is, my...
8
by: '69 Camaro | last post by:
Perhaps I'm Googling for the wrong terms. Does anyone have links to examples of the syntax necessary to read the HTML on another Web page when that HTML is produced from JavaScript using the...
0
by: Lars Woetmann | last post by:
what is the definition of sub-functions in the hotshot profiler? and just as important what is not sub-functions from the output I can see that functions I made and functions in...
1
by: Brian Quinlan | last post by:
I have a misinformed theory that I'd like to share with the list. I believe that profiler calibration no longer makes sense in Python 2.4 because C functions are tracked and they have a different...
18
by: robert | last post by:
Is there a ready made function in numpy/scipy to compute the correlation y=mx+o of an X and Y fast: m, m-err, o, o-err, r-coef,r-coef-err ? Or a formula to to compute the 3 error ranges? ...
4
by: Vai2000 | last post by:
Hi All, Does anyone know of a tool which can profile my assembly, so that I get a stats on all the methods called and how much time each took? TIA
1
by: starter08 | last post by:
Hi, I have a C++ routine(client-side) which uploads an xml file to a web server by making a socket connection and sending all the post request through that socket. On the server side I have a cgi...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
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...

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.