[sldev] [patch] OpenJPEG DWT optimizations
Callum Lerwick
seg at haxxed.com
Wed Apr 4 02:34:47 PDT 2007
On Wed, 2007-04-04 at 00:30 -0700, Dzonatas wrote:
> This means over 50% of the time spent in the the OpenJPEG DWT is in the
> overhead of data manipulation.
One thing I've noticed is OpenJPEG will eat a hell of a lot of RAM,
roughly proportionate to the image size. Whereas KDU doesn't even make
my RAM meter budge, even on the biggest image I have! OpenJPEG has a bit
of a problem with allocating huge data structures all over the place,
and that means cache thrashing any way you slice it. The DWT seems to
thrash the cache quite badly, and this is probably the source of much of
the slowness you're seeing.
Check out my latest oprofile run of slviewer. This is from the end of
dwt_decode_real:
* CPU: PIII, speed 1328.96 MHz (estimated)
* Counted CPU_CLK_UNHALTED events (clocks processor is not halted)
* Counted DCU_LINES_IN events (total lines allocated in the DCU)
1666 0.0120 64 0.0861 : for (j = 0; j < rw; ++j) {
: aj = a + j;
2825 0.0203 60 0.0807 : dwt_interleave_v(aj, bj, dn, rh1, w, cas_row);
1567 0.0113 47 0.0632 : dwt_decode_1_real(bj, dn, rh1, cas_row);
1865412 13.4263 11704 15.7464 : for (k = 0; k < rh; ++k)
9018 0.0649 294 0.3955 : aj[k * w] = bj[k];
: }
: }
Second Life hits this loop hard. Its just a data copy loop! This needs
to be fixed one way or another, via rearranging data structures and just
plain cutting down the memory footprint of the working data buffers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20070404/2562c175/attachment.pgp
More information about the SLDev
mailing list