Open malloch opened 2 weeks 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.)
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
I have another upcoming commit to add to the PR then I will take it out of draft.
Pinging @radarsat1 – please let me know if you have any concerns about the PR or items to discuss!
Server code reorganization & consolidation, fixes some erroneous behaviour and hopefully makes future maintenance easier:
lo_servers_wait
internally for all calls topoll
/select
, i.e. with a 0 timeout forlo_server_recv
. This removes a bunch of duplicate codepoll
/select
again if we already know something was receivedlo_server_wait
andlo_servers_wait
if returning early due to error rather than msg received or full timeoutlo_server_recv
if a received message was queued for future dispatchAdds 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 thealloca
?). On MacOS/M2 Pro, thetestspeed
test in libmapper completes in ~4.3 seconds using the liblopoll
path and ~2.6 seconds usingselect
.