From: Javier Serrano Polo <jasp00@te...> - 2006-05-26 20:41:31
Using the garbage collector looks like a bad idea but as long as it works...
I certainly wouldn't be able to maintain such a thing.
I've got problems tracing this one. Question: why all those #defines in
oscillator.cpp? Is there a reason you're not using inheritance or
Am Freitag, 26. Mai 2006 22:45 schrieb Javier Serrano Polo:
> Hi, Danny.
> Using the garbage collector looks like a bad idea but as long as it
> works... I certainly wouldn't be able to maintain such a thing.
I think too, that we shouldn't introduce things like garbage collectors, as=
they might slowdown and bloat LMMS a lot. We'd better keep an eye on=20
programming everything as clean and stable as possible...
> I've got problems tracing this one. Question: why all those #defines in
> oscillator.cpp? Is there a reason you're not using inheritance or
> function pointers?
this is just for getting more optimized code. This way the static=20
wave-shape-routines of oscillator-class can be really inlined.=20
=46unction-pointers for such *really small* methods would cost way too much=
CPU-time. The same for inheritance, which is nice, but slow (because of=20
vtables etc.!). The defines form the basic-code which is some kind=20
of "specialized" by the parameters and can be optimized a lot as the compil=
exactly knows, which wave-shape-routes is used in all places and therefore=
can speed up things a lot... I know that this isn't a really nice solution,=
but the oscillator-class and their methods probably contain the mostly=20
executed code at all.
Just think whats happening when the user plays let's say three notes with=20
triple-oscillator with chord=3Doctave and range=3D3, this makes 27 oscillat=
for each channel -> 54 for stereo -> 54 * 44100 =3D 2.381.400 cycles per se=
in oscillator::updateX(...)-methods! And this is just one instrument!=20
Everything clear? ;-) Actually we'd need some really fast inline=20
MMX/SSE-asm-code on intel-platform...
Keulen sind als Vernichtungswerkzeuge etwas aus der Mode. Aber das
Schicksal bedient sich ihrer noch.
-- Heinz R=FChmann
Get latest updates about Open Source Projects, Conferences and News.