Jesús Díaz Vico
2010-Feb-11 00:26 UTC
[Vorbis-dev] Excessively inefficient source code modifications
Hello, I've made some changes in the libvorbis-1.2.3 source code to introduce some functionality I need for a project I'm working on. For compilation, besides including some macro definitions I need to pass to the C preprocessor, and linking with the math library somewhere (and including the source files I've implemented, of course) I've made no big changes in the Makefile or configure scripts. But when I run my modified oggenc program, the execution time becames excessive (for coding 2 secs of audio it spents approximately 2 mins, with default parameters). The modifications I've made consist basically in some extra computation involving the residual vectors (so it executes once for each residue vector). I've measured independently the average time for the whole extra code and it takes approximately 0.00012 secs per call (so that would make roughly 0.00012*channels*frames extra encoding time for an audio file). Despite I've re-re-rechecked my code and I haven't found anything strange, I don't discard at all that may be there are some algorithmic errors left that may make my code be a bit inefficient, but making 2 secs go to 2 mins is quite alarming and far away from permissible. Supposing I have no important algorithmic errors, could this excessive overload be caused by a compiling issue? (that wouldn't surprise me, as my knowledge about autoconf/automake/make scripts is quite basic...). I'd just like to discard the fact of having a compilation issue before starting another intensive and detailed analysis of the code. If after another bunch of extra hours and thousands of code lines rechecked, I find that it was a compilation issue, I might be forced to make a pilgrimage to the Himalayas to find myself or something... ;) Thank you all.
Conrad Parker
2010-Feb-11 00:31 UTC
[Vorbis-dev] Excessively inefficient source code modifications
On 11 February 2010 09:26, Jes?s D?az Vico <jesus.diaz.vico at gmail.com> wrote:> Hello, > > I've made some changes in the libvorbis-1.2.3 source code to introduce > some functionality I need for a project I'm working on. For compilation, > besides including some macro definitions I need to pass to the C > preprocessor, and linking with the math library somewhere (and including > the source files I've implemented, of course) I've made no big changes > in the Makefile or configure scripts. But when I run my modified oggenc > program, the execution time becames excessive (for coding 2 secs of > audio it spents approximately 2 mins, with default parameters). The > modifications I've made consist basically in some extra computation > involving the residual vectors (so it executes once for each residue > vector). I've measured independently the average time for the whole > extra code and it takes approximately 0.00012 secs per call (so that > would make roughly 0.00012*channels*frames extra encoding time for an > audio file). Despite I've re-re-rechecked my code and I haven't found > anything strange, I don't discard at all that may be there are some > algorithmic errors left that may make my code be a bit inefficient, but > making 2 secs go to 2 mins is quite alarming and far away from > permissible. Supposing I have no important algorithmic errors, could > this excessive overload be caused by a compiling issue? (that wouldn't > surprise me, as my knowledge about autoconf/automake/make scripts is > quite basic...). > > I'd just like to discard the fact of having a compilation issue before > starting another intensive and detailed analysis of the code. If after > another bunch of extra hours and thousands of code lines rechecked, I > find that it was a compilation issue, I might be forced to make a > pilgrimage to the Himalayas to find myself or something... ;)what platform and compiler are you using, and can you post your changes somewhere as a patch (both code and build changes). Conrad.
xiphmont at xiph.org
2010-Feb-11 00:34 UTC
[Vorbis-dev] Excessively inefficient source code modifications
As long as its reproducible, it should be easy to find :-) You profiled the additions, have you profiled the complete code while it's misbehaving? Monty
Jesús Díaz Vico
2010-Feb-11 21:22 UTC
[Vorbis-dev] Excessively inefficient source code modifications
Thank you, Martin. Martin Leese escribi?:> Have you compiled and run the code without > your modifications? If that is slow then you > have a compiler issue. > > Regards, > MartinYes, I've also run the code without my modifications and it behaves normally. Hmmm... I'm seeing now that yesterday I sent my answers to Conrad and Monty's emails just to Monty (I really needed to get some sleep). I copy what I answered here: Jesus Diaz Vico <jesus.diaz.vico at gmail.com> wrote:>Thank you for your quick answers. > >Conrad Parker wrote: >> what platform and compiler are you using, and can you post your >> changes somewhere as a patch (both code and build changes). >> >> Conrad. > >I'm using gcc 4.3.3 in an Ubuntu 9.x (I've tested it in Ubuntu 9.04 >and 9.10, therefore the x ;)). Now I can't post it (it is quite late >here (almost 2.00 a.m.) and I don't have any patch prepared and I >still have to attend some other stuff). I'll try to do it soon. > >xiphmont at xiph.org wrote: >> As long as its reproducible, it should be easy to find :-) >> >> You profiled the additions, have you profiled the complete code while >> it's misbehaving? >> >> Monty > >Yes, and the strange thing is that I don't see any misbehavior in the >timing of each call to my functions, although the program misbehaves as >a whole and therefore it is something wrong with my modifications...I guess it is a algorithmic/coding problem then...