[Cuis-dev] Why is this slower?

Hernán Wilkinson hernan.wilkinson at 10pines.com
Wed May 27 03:47:50 PDT 2026


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/ca4a1d3a/attachment.htm>


More information about the Cuis-dev mailing list