[PD-dev] macOS direct plist reading

Dan Wilcox danomatika at gmail.com
Tue Nov 26 01:20:48 CET 2019


Howdy all,

Pd's start time on macOS has always felt a bit *slow*. Recently, someone on the pd-list noticed starting Pd with -noprefs helps a great deal.

I did some digging and the core basically performs a system call to the "defaults" command for *each* key/value in s_file.c, including a stat() check if the preferences file exists. That's a good amount of filesystem IO and probably explains why it takes *3-4 seconds* on my machine.

For a proposed update to fix this, I just got some code working which reads the plist into a dictionary object directly using the macOS CoreFoundation framework (all C). Reading keys and values is then much faster and Pd starts up almost instantaneously now. Next step would be to updating preference saving as well.

I hope to finalize this and put it up as a PR in a week or two for testing.

--------
Dan Wilcox
@danomatika <http://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20191126/f1ddce7d/attachment.html>


More information about the Pd-dev mailing list