Re: [Audacity-devel] doubles and floats
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Dominic M. <do...@au...> - 2006-02-24 08:28:45
|
On Feb 23, 2006, at 11:47 PM, Steve Harris wrote: > On Thu, Feb 23, 2006 at 08:09:06 -0500, Mar...@ao... wrote: >> Hi >> >> Pardon my ignorance (yet again) but should I be using doubles >> or floats >> for variables that are, effectively, part of the UI and won't >> have much >> effect on a signal? For examples, the frequency scale of an >> equalizer, >> the log of the frequency scale etc.. Does it make any performance >> differences to anybody? My (uninformed) guess is that it would >> be OK to >> ditch float and use double for everything (on a modern >> machine), but I >> don't know what I'm talking about in this realm. > > Personally I doubt very much that it would make a difference, the main > reason we use floats in DSP routines it to reduce the cache damage, > when > streaming lots of data, but the data structures in GUI code are so > huge > that the odd extra 32bits here and there probably doesn't matter. Agreed. I've done some performance comparisons and for large arrays, floats are about twice as fast as doubles, on a wide range of processors. Basically, memory bandwidth is often more of a bottleneck. For computation-intensive code, that difference disappears, so you should almost always use doubles. For your application: use doubles. - Dominic > - Steve > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the > live webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Audacity-devel mailing list > Aud...@li... > https://lists.sourceforge.net/lists/listinfo/audacity-devel |