Skip to main content
areohbee
Legend
May 28, 2011

P: SDK: LrTasks.yield is *extremely* slow on Windows

  • May 28, 2011
  • 27 replies
  • 919 views

Lightroom SDK: LrTasks.yield is extremely slow on Windows.
(its over 100 times slower on Windows than Mac - something is really amiss...)

I sure hope this gets fixed soon - any plugins calling it repeatedly in a loop run like molasses in winter (on Windows).

This topic has been closed for replies.

27 replies

areohbee
areohbeeAuthor
Legend
May 31, 2011
Well said.
Participating Frequently
May 31, 2011
That's probably the best argument for fixing it. It's a portability issue. It's just too easy to forget it and create performance problems.
areohbee
areohbeeAuthor
Legend
May 31, 2011
Thanks Dan. Yeah, plugin authors who know about the problem can avoid it... I have assumed the Lightroom programmers know about it too and avoid it similarly, although there are some SDK functions that take so much longer to run on Windows than Mac its gotta make a guy wonder...

It helps just knowing its "acknowledged"...
Participating Frequently
May 31, 2011
Interesting. That might give me my excuse push for getting this plumbing issue fixed. I'll take a look.
Participating Frequently
May 31, 2011
Yeah, I've run across this. The underlying implementation of event loop dispatch on Windows is based on a timer primitive with much lower resolution than what was used on the Mac.

The best answer at the moment for this specific manifestation of that is don't yield so often (the timer on Windows has roughly 10 ms refsolution, if you yield more often than that in a tight loop, you'll take a walltime hit). There's actually a routine in the internal event loop called yieldAfterElapsed time that is used to make it easier to avoid this kind of high-frequency yielding.

It's not something we'd fix in a dot release (too risky), but if I can find a case where it's causing a significant performance deficit (that isn't resolved by reducing yield frequency a bit, which is probably better anyway), I think it'd be possible to implement a higher precision approach for the next major rev.
areohbee
areohbeeAuthor
Legend
May 28, 2011
Is this problem acknowledged by Adobe/Chet?
johnrellis
Legend
May 28, 2011
Also, it appears that some SDK API methods call LrTasks.yield() internally and are thus much slower on Windows than Mac. See these threads for more discussions with Rob on this issue:

http://forums.adobe.com/message/3264134
http://forums.adobe.com/message/33902...