Dear all,
Can anyone tell me what is more computationally efficient, the use of chains of individual mathematical operator objects or their equivalent in a single expr(~) object. For example, what would be quicker:
| | [+~ ] | [*~ 20]
or
[expr~ ($v1 + $v2) * 20]
Jamie
ciao i remember that someone from the list wrote that using [expr] or [expr~] consumes more cpu than doing the equivalent with 'conventional' objs. but i can't remember the reason and how much the difference is. maybe you'll find it by searching the archive.
roman
----- Original Message ----- From: "Jamie Bullock" jamie@postlude.co.uk To: pd-list@iem.at Sent: Saturday, January 15, 2005 11:48 PM Subject: [PD] expr and expr(~) vs individual operators
Dear all,
Can anyone tell me what is more computationally efficient, the use of chains of individual mathematical operator objects or their equivalent in a single expr(~) object. For example, what would be quicker:
| | [+~ ] | [*~ 20]
or
[expr~ ($v1 + $v2) * 20]
Jamie
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
i remember that someone from the list wrote that using [expr] or [expr~] consumes more cpu than doing the equivalent with 'conventional' objs. but i can't remember the reason and how much the difference is. maybe you'll find it by searching the archive.
i once did a small benchmark ... seemed that expr and the pd objects are about the same ... not sure about expr~, though ..
still, if you are about tweaking your system to hell, the best solution is k_cext, since it does your task in native machine code ...
cheers ... tim
"Roman Haefeli" reduzierer@yahoo.de writes:
ciao i remember that someone from the list wrote that using [expr] or [expr~] consumes more cpu than doing the equivalent with 'conventional' objs. but i can't remember the reason and how much the difference is. maybe you'll find it by searching the archive.
I remember that a long time ago, on a Pentium 566Mhz I found that the combination of [expr~] and regular pd operators was the most efficient solution to complex equasions. YMMV, but I think that only experimentation will give the best results. On my AthlonXP 2400 the difference between the 2 approaches was negligible (in that particular case).
./MiS
Hallo, Michal Seta hat gesagt: // Michal Seta wrote:
"Roman Haefeli" reduzierer@yahoo.de writes:
i remember that someone from the list wrote that using [expr] or [expr~] consumes more cpu than doing the equivalent with 'conventional' objs. but i can't remember the reason and how much the difference is. maybe you'll find it by searching the archive.
I remember that a long time ago, on a Pentium 566Mhz I found that the combination of [expr~] and regular pd operators was the most efficient solution to complex equasions. YMMV, but I think that only experimentation will give the best results. On my AthlonXP 2400 the difference between the 2 approaches was negligible (in that particular case).
I didn't do any extensive benchmarking, but I suppose, that the difference will not really matter, and if it does, only benchmarking your actual patches will give the solution.
But in any way, the expr-family of objects is much faster when it comes to do the patching itself and can be a major time saver. I would encourage anyone to use them a lot. Something like:
expr if ( $f1 > 0, 1/$f1, pow($f1, 2) )
might look a bit scary at first, but if you do this as single objects, it is really longwinded.
Frank Barknecht _ ______footils.org__
Yes,
Thanks to all who replied. I have been using the expr family a lot for this very reason, and just wanted to check I wasn't creating overhead. Seems like if I am, it is negligible and worth the trade-off.
Jamie
On Sun, 2005-01-16 at 22:00, Frank Barknecht wrote:
Hallo, Michal Seta hat gesagt: // Michal Seta wrote:
"Roman Haefeli" reduzierer@yahoo.de writes:
i remember that someone from the list wrote that using [expr] or [expr~] consumes more cpu than doing the equivalent with 'conventional' objs. but i can't remember the reason and how much the difference is. maybe you'll find it by searching the archive.
I remember that a long time ago, on a Pentium 566Mhz I found that the combination of [expr~] and regular pd operators was the most efficient solution to complex equasions. YMMV, but I think that only experimentation will give the best results. On my AthlonXP 2400 the difference between the 2 approaches was negligible (in that particular case).
I didn't do any extensive benchmarking, but I suppose, that the difference will not really matter, and if it does, only benchmarking your actual patches will give the solution.
But in any way, the expr-family of objects is much faster when it comes to do the patching itself and can be a major time saver. I would encourage anyone to use them a lot. Something like:
expr if ( $f1 > 0, 1/$f1, pow($f1, 2) )
might look a bit scary at first, but if you do this as single objects, it is really longwinded.
Ciao
Frank Barknecht fbar@footils.org writes:
expr if ( $f1 > 0, 1/$f1, pow($f1, 2) )
Yes. However, I was not clear in my previous post. I was refering to [expr~] using signal vectors and such. And back then I was really paranoid about CPU usage because of the slow machine and I was willing to try just about anything to save 1% of CPU.
./MiS