In many Pd does this already. https://sourceforge.net/p/pure-data/pure-data/ci/0.47-1/tree/src/d_arithmetic.c?format=raw
see "scalarover_perform" for instance: it computes a single division and then runs multiplications in the loop. But I think the compiler would figure out this on its own (perhaps with the help of -ffast-math ?). I guess a more optimized version would compute the division only when a new message is received (as opposed to once every block). Of course there is not much that can be done for the signal version of [/~]. Compiler optimizations are there, at least in part. https://sourceforge.net/p/pure-data/pure-data/ci/637ef74e1745a658c0cfdc40d65de189b4fbf02a/tree/configure.acSome architectures may require more explicit flags to perform better (e.g.: on ARM Cortex, you may want to tell to use -mfpu=neon to enable the use of the faster NEON SIMD. Giulio________________________________ From: Dario Sanfilippo <sanfilippo.da...@gmail.com> To: pd-list <pd-l...@iem.at> Sent: Wednesday, 8 March 2017, 22:37 Subject: [PD] Is PD using CPU optimisation? Hello, list. Would it be sensible to, for example, start using multiplications over divisions when possible or will the compiler take care of that? Cheers, Dario _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list