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

Profiling python 2.3

I wonder what would be a good way to profile a python program where the
main thread starts two worker threads that do all the work.

I get no infomation at all from the threads.

I tried to use profile.run as the first thing in the new thread and the
thread starts and works fine but when it exits I get this error

File "/usr/lib/python2.3/profile.py", line 71, in run
prof = prof.run(statement)
File "/usr/lib/python2.3/profile.py", line 403, in run
return self.runctx(cmd, dict, dict)
File "/usr/lib/python2.3/profile.py", line 409, in runctx
exec cmd in globals, locals
TypeError: exec: arg 1 must be a string, file, or code object

The main problem I have is that when I add a small function to a program
the resulting code takes longer than it should. The program takes
about 80% normally and end up taking more than 100%. I did a small test
of the new funtions and when I run that alone it only takes 20%-25% so
the result sould not take more than 50% and now I need to know where the
time is spent.
Jul 18 '05 #1
2 1513
In message <ct**********@newstree.wise.edt.ericsson.se>, Kenneth
Johansson <ke*@switchboard.ericsson.se> writes
I wonder what would be a good way to profile a python program where the
main thread starts two worker threads that do all the work.

I get no infomation at all from the threads.


Python Performance Validator (beta)

http://www.softwareverify.com/python...tor/index.html

Stephen
--
Stephen Kellett
Object Media Limited http://www.objmedia.demon.co.uk
RSI Information: http://www.objmedia.demon.co.uk/rsi.html
Jul 18 '05 #2
On Fri, 28 Jan 2005 10:02:33 +0000, Stephen Kellett wrote:
In message <ct**********@newstree.wise.edt.ericsson.se>, Kenneth
Johansson <ke*@switchboard.ericsson.se> writes
I wonder what would be a good way to profile a python program where the
main thread starts two worker threads that do all the work.

I get no infomation at all from the threads.


Python Performance Validator (beta)

http://www.softwareverify.com/python...tor/index.html

Stephen


I develop on linux.

Nice to see I do not have to recompile and relink to use the tool that's a
real problem with other python stuff ;)
Jul 18 '05 #3

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

Similar topics

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...
2
by: Irmen de Jong | last post by:
Hello I haven't received any responses on my original posting, and it could very well be that it never made it to the newsgroup (because I can't find it back on my news server here). So I'm...
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...
1
by: Dave | last post by:
Hello All, I'm trying to profile a Python program using gprof, but I don't understand some of the results, especially what some of the functions do. For example, _moncount, mcount,...
13
by: Jens Theisen | last post by:
Hello, I want to apologise in advance for this being off topic. It's not neither A C nor a C++ question, but to profiling in general, though I my chances are best to find the answer in the C/C++...
2
by: Andreas Røsdal | last post by:
Hi, I'm using the Python profiler to optimize a pathfinding algorithm of a game, and would like some help from someone who knows how to improve the performance of Python code. The algorithm is...
0
by: Gregory Piñero | last post by:
Hey Folks, Some import questions that a search didn't turn up for me. 1. Will "from somemodule import onething" take as long to start up as import somemodule? 2. Is there anyway I can get at...
0
by: L'eau Prosper Research | last post by:
Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases new TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set. L'eau Prosper Market...
0
by: L'eau Prosper Research | last post by:
NEW TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set By L'eau Prosper Research Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases...
9
by: Peter Duniho | last post by:
I'm especially hoping Ben Voigt and/or Bob Powell see this (I saw their names on the m.p.d.f.performance newsgroup :) ) I would have posted to the performance newsgroup, but I see very little on...
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.