radarsat1 / liblo

liblo is an implementation of the Open Sound Control protocol for POSIX systems
GNU Lesser General Public License v2.1
192 stars 60 forks source link

Optimize server2 #163

Open malloch opened 2 weeks ago

malloch commented 2 weeks ago

Server code reorganization & consolidation, fixes some erroneous behaviour and hopefully makes future maintenance easier:

Adds a configure/cmake option for disabling poll if desired since testing shows a substantial performance penalty for using this code path in liblo (possibly due to the alloca?). On MacOS/M2 Pro, the testspeed test in libmapper completes in ~4.3 seconds using the liblo poll path and ~2.6 seconds using select.

radarsat1 commented 1 week ago

No objection here, if you want to take it out of draft I will merge it. (Although I find it very surprising that either poll or alloca would cause any latency.)

malloch commented 1 week ago

Apparently the slow poll is a BSD/MacOS thing, with the only solution to use kqueues instead: https://forums.developer.apple.com/forums/thread/764698

malloch commented 1 week ago

I have another upcoming commit to add to the PR then I will take it out of draft.

malloch commented 1 hour ago

Pinging @radarsat1 – please let me know if you have any concerns about the PR or items to discuss!