[PD-dev] performance of different Wish versions

Roman Haefeli reduzent at gmail.com
Thu Jul 13 23:22:10 CEST 2023


Hey all

I was seeing a suspiciously high CPU usage (~52% in Acitivity Monitor)
on macOS with one of my patches basically idling. It turned out to be
the GUI process and not 'pd'. Then I figured out that it was related to
frequently changing the color of a [cnv] in a GOP. The same patch with
the same rate of color changes eats almost no CPU on Linux (4-5% in
htop).  

Because of lack of better ideas, I tried to build a Pd-0.54.0.app based
on different Wish versions. On macOS 12.1.6 (Monterey, the only version
I have currently access to), I was able to create the following Wish
versions with the help of the tcltk.sh script that is part of the pure-
data repo:

  - 8.6.11
  - 8.6.12
  - 8.6.13

8.6.10 doesn't seem to build on macOS 12, so I didn't try smaller
versions. 

The biggest difference between different Wish versions I got with the
patch flat-gops-refreshing-often.pd. When turning on the [metro] and
let a signle GOP square blink by clicking into the light green area,
those are the CPU usages I see with different Wish versions / Pd 0.54-
0:

  - 8.6.12 67%
  - 8.6.13 65%
  - 8.6.11 %6

Yeah, in this particular test, 8.6.11 is 11x faster than 8.6.12!

With some other tests the differences are less pronounced. When
flickering a [cnv] directly in the patch (not GOP), all versions show
similar CPU usages. With another patch (not included), 8.6.13 is
clearly better than 8.6.12, but still beaten by a wide margin by
8.6.11.

The unusual high CPU usage seems related to GOP usage. The flat-gops-
refreshing-often patch holds many instances of a GOP abstraction. It
performs badly even the other GOP instances are not flickering.
However, when number of idling GOP abstractions is reduced, the
flickering instance eats much less CPU. 


Miller's 0.54-0 release apparently uses 8.6.12 which - according to my
tests - performs the worst of the three tested versions. 

This is my test env:
  - Pd 0.54-0 (built with 'make app')
  - macOS 12.6.3
  - Wish/TclTk
     - 8.6.11
     - 8.6.12
     - 8.6.13

My test builds and some test patches are included here:
https://netpd.org/~roman/tmp/wish-speed-macos.tar.gz
 

Cheers
Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20230713/c8eac358/attachment.sig>


More information about the Pd-dev mailing list