[opensource-dev] Openjpeg/KDU the cold hard metrics
sheet.spotter at gmail.com
Sun Sep 26 08:49:48 PDT 2010
Execution time from the profile includes sub-functions.
For example, the tcd_t1_decode function calls the t1_decode_cblks function
multiple times. The execution time for tcd_t1_decode includes the time for
every call to t1_decode_cblks.
The t1_decode_cblk function was responsible for most of the execution time
(121 out of 128 seconds). Almost all of this time in this function is split
between three other functions t1_dec_sigpass (51 seconds), t1_dec_refpass
(36 seconds), and t1_dec_cInpass (35 seconds). Each of these functions make
millions of calls to only a few other functions.
The profiler was written very simply.
The profiler consists of a single CProfiler class in C++. The constructor
records the start time using a high resolution timer. The destructor
calculates the elapsed time and updates a collection of counters.
Declaring a variable of the CProfiler class is all that's required to
capture the execution time and call count. The constructor accepts a single
argument, which is used as a unique identifier. Results are grouped by this
identifier. The name of the function was used at the unique identifier.
After running the simulation a static method is called to dump the
The most expensive part of the coding was adding CProfiler variables to the
start of each function. No attempt was made to subtract out the time spent
in sub-routines. No attempt was made to subtract out the impact of the
CProfiler class itself.
The CProfiler class will not be submitted to the OpenJPEG source code.
Comments in their Google group suggest they prefer to limit the source code
to C and are not interested in using C++ objects.
From: lee.sailer at gmail.com [mailto:lee.sailer at gmail.com] On Behalf Of Ponzu
Sent: September 26, 2010 10:03 AM
To: Sheet Spotter
Cc: Robin Cornelius; opensource-dev
Subject: Re: [opensource-dev] Openjpeg/KDU the cold hard metrics
Does the execution time *include* the time of sub-functions called, or does
On Sun, Sep 26, 2010 at 3:02 AM, Sheet Spotter <sheet.spotter at gmail.com>
I created a crude profiling tool to determine where to focus on improving
the performance of OpenJPEG v2.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the opensource-dev