So I haven't spent as much time as I may need to, and do not understand windows vs mac under the hood well enough to know if this is just a windows limitation, but here it goes.
It looks like when reaper updates gui elements, for example when a user moves an item, it blocks calls to reaper.defer().
I caught this when moving some defer editing scripts over to mac, the performance was leaps and bounds better than on windows. These scripts rely on getting item info as the user start's their edit. Because defer is blocked for a short time when gui elements are redrawn (i'm guessing this is the case) the efficacy of the scripts are dependant on the user's edit speed.
Here's a comparison of defer calls on Mac and Windows. (both are captured after various edit commands, moves/trims etc.)
Just want to call attention to this in case this is something that can be resolved, or it'd be nice to know if this is a known limitation of deferred scripts on windows.
This is the code:
Code:
call_count = 0
function main()
call = os.time()
call_count = call_count + 1
if call ~= prev_call then
reaper.ShowConsoleMsg("Defer Call:\t" .. call .. "\tCall Count:\t" .. call_count .. "\n")
call_count = 0
end
prev_call = call
reaper.defer(main)
end
reaper.atexit(function()gfx.quit()end)
main()
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
On windows you can see that the # of calls severely diminishes when user activity increases with some of the calls being blocked for over a second.
Windows:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Mac is very stable at 31-32 calls per second
Mac: