[GEM-dev] Why is [hsv2rgb] implemented as an abstraction?
Claude Heiland-Allen
claudiusmaximus at goto10.org
Tue Dec 11 17:15:30 CET 2007
IOhannes m zmoelnig wrote:
> Claude Heiland-Allen wrote:
>> Hi all,
>>
>> Just wondering why hsv2rgb.pd (which is pretty incomprehensible) isn't
>> a compiled external. I had to write a C implementation because the Pd
>> implementation was too slow. Some rough benchmarks:
>>
>> CPU: 1.6GHz Pentium-M
>> Patch: rather complex, with 25*1024 calls to hsv2rgb per second.
>> CPU-load as reported by load-meter.pd:
>> hsv2rgb.pd : 108%
>> fast_hsv2rgb.c : 94%
nop.pd : 94%
>> Quite a difference.
>
> honestly i think that the difference is way less than i would have
> expected it.
The benchmark wasn't clean - the patch was doing a whole bunch of other
stuff at the same time. See revised benchmark above, and see below for
a clean benchmark:
hsv2rgb.pd : 26900 cputime (including test source) [1]
fast_hsv2rgb.c : 6730 cputime (including test source) [2]
no object : 5750 cputime (test source) [3]
([1]-[3]) / ([2]-[3]) gives 21.8
C is almost 22x (2200%) faster than the Pd implementation of hsv2rgb.
Claude
--
http://claudiusmaximus.goto10.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: benchmark-hsv2rgb.pd
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20071211/728ff62d/attachment.asc>
More information about the GEM-dev
mailing list