[Cuis-dev] Why is this slower?

Luciano Notarfrancesco luchiano at gmail.com
Wed May 27 05:06:44 PDT 2026


Great, thanks. And I was about to ask about this other thing too, also
related to the VM, so I'll ask here.

I just modified building/macos64ARMv8/common/Makefile.plugin and changed
-Os to -O3, and this only change is enough to autovectorize the
FloatArrayPlugin with clang. Testing on Float32Arrays of size 128 I get a
speedup of exactly 3x on my Macbook Air M4. This is a huge speedup for my
audio DSP project, I hope we can compile this plugin with -O3 (and also
perhaps the FFT plugin), is there any reason not to do so? Can we just make
this change in common/Makefile.plugin or is there any way to make it
specific to FloatArrayPlugin?

Thanks,
Luciano

On Wed, May 27, 2026 at 5:48 PM Hernán Wilkinson <
hernan.wilkinson at 10pines.com> wrote:

> I think @Eliot Miranda <eliot.miranda at gmail.com> is the right person to
> answer :-)
>
> On Sun, May 24, 2026 at 8:32 AM Luciano Notarfrancesco via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> I have a class that implements a one pole filter, with instance variables
>> pole and y (the last output). It implements
>>
>> value: in
>>     ^ y := (1.0 - pole) * in + (pole * y)
>>
>> The following implementation is equivalent, but uses one less arithmetic
>> operation:
>>
>> value: in
>>     ^ y := (y - in) * pole + in
>>
>> I was surprised to find out that the second implementation is 35% slower
>> (measured with BlockClosure>>bench). From just looking at the bytecodes
>> naively, it looks like a "pushTemp: 0" is much slower than a
>> "pushRcvr: 0" + a "pushConstant: 1.0" + "send: *". Anyone know what's
>> exactly going on? Is there an easy way to print the generated native code?
>> I'm just curious, not a big deal.
>>
>> Thanks,
>> Luciano
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
>
>
> --
>
> *Hernán WilkinsonAgile Software Development, Teaching & Coaching*
> *Phone: +54-011*-4893-2057
> *Twitter: @HernanWilkinson*
> *site: http://www.10Pines.com <http://www.10pines.com/>*
> Address: Alem 896, Floor 6, Buenos Aires, Argentina
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260527/737bfc8f/attachment.htm>


More information about the Cuis-dev mailing list