473,396 Members | 1,771 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.

Is there a way to profile underlying C++ code?

Dear list,

I have a C++-SWIG-wrapped python module. The running time for one of the
functions is pretty unpredictable so I would like to profile it.
However, the python profiler does not seem to enter the compiled module
(.so file). Is there a way to profile the C++ functions?

Many thanks in advance.
Bo
Jan 25 '06 #1
3 1808
Bo Peng wrote:
Dear list,

I have a C++-SWIG-wrapped python module. The running time for one of the
functions is pretty unpredictable so I would like to profile it.
However, the python profiler does not seem to enter the compiled module
(.so file). Is there a way to profile the C++ functions?


On Linux you can use oprofile (which is pretty nice and easy to use ---
no recompiling. Just start the profiler, run your code, and stop the
profiler).

http://oprofile.sourceforge.net/about/

-Travis

Jan 25 '06 #2
Travis E. Oliphant wrote:
On Linux you can use oprofile (which is pretty nice and easy to use ---
no recompiling. Just start the profiler, run your code, and stop the
profiler).


Thank you very much for the tip. This is a great tool.

The source of the problem has been found: cache misses. Briefly, I have
a long array and I need to choose numbers from it randomly. When the
array is short, the performance is good. When the array is big, picking
a number will cause a cache miss almost all the time. This results in
almost doubled execution time.

Problem found, but I am out of idea how to fix it since the nature of my
algorithm is working randomly on large arrays.

Cheers,
Bo
Jan 25 '06 #3
Bo Peng a écrit :
Travis E. Oliphant wrote:
On Linux you can use oprofile (which is pretty nice and easy to use
--- no recompiling. Just start the profiler, run your code, and stop
the profiler).

Thank you very much for the tip. This is a great tool.

The source of the problem has been found: cache misses. Briefly, I have
a long array and I need to choose numbers from it randomly. When the
array is short, the performance is good. When the array is big, picking
a number will cause a cache miss almost all the time. This results in
almost doubled execution time.

Problem found, but I am out of idea how to fix it since the nature of my
algorithm is working randomly on large arrays.

Cheers,
Bo


There might be one possibility for you. If the order of the random
positions you get has no meaning for the final result, you could start
by generating all those numbers, sort the list and then do the lookups.
Jan 26 '06 #4

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

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
3
by: Tim Marsden | last post by:
Hi, I am having difficulties understanding the use of the cache in my profile (C:\Documents and Settings\username\Local Settings\Application Data\assembly\dl2) My application seems to be using...
6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
4
by: Marco Assandri | last post by:
Hi everybody, I have a problem with this code. 'An anonymous username copied from the Username column of Aspnet_Users table with IsAnonymous = True dim SurelyAnonymousUsername =...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
9
by: Kirk | last post by:
I have successfully, implemented a custom Membership Provider to a SQL 2000 table, however, I am having problems doing the same with a Profile Provider. As I understand it, the steps for both of...
1
by: Steven Nagy | last post by:
Hi all, I want to know if it is possible to have a WCF service hosted in IIS (.svc) that uses the provider model in .Net? Ideally, I'd like the WCF service methods to detect the user's AD user...
3
by: Oriane | last post by:
Hi there, I would like to open my Asp.Net project as a "Web Application" rather than as a "Web Site" in Visual Studio. But the thing is that I use the System.Web.Profile and the auto-generated...
1
by: shapper | last post by:
Hello, I am using a custom Profile provider as follows: public class Profile : ProfileBase { public Bio Bio { get; set; }
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...
0
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...

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.