Skip to main content
Known Participant
November 1, 2012
解決済み

Rendering for a plugin does not multithread?

  • November 1, 2012
  • 返信数 1.
  • 1691 ビュー

Hi all, I'm writing a plugin that exports selected images, runs an external program to do some calculations, then writes metadata back to the original image in Lightroom.  I've notice some things that are odd:

  • Lightroom seems to be taking its sweet time rendering the images.  I've got an 8 core Mac and it looks like images are being rendered serially.  I would have expected that LR would render 8 images simultaneously.
  • Metadata values are not updated in the UI  until the entire task is finished, even on the first image rendered.

I've tried inserting LrTasks.yield() in various places in my plugin, but that seems to have made it even slower!  Does anyone know how the underlying threading mechanism works?  I want to hear my machine's fans screaming! 😉  Thanks in advance...

このトピックへの返信は締め切られました。
解決に役立った回答 areohbee

Regarding point #1:

Not sure I can tell you anything you don't already know:

Exports within a single session are serial.

If you want parallel exports you need to create multiple export sessions.

Some performance improvement can be had that way, but don't get your hopes up too high.

Regarding point #2 - Lr does seem to update stuff on it's own schedule, I've tried various things to convince it to update stuff, but with only marginal success (e.g. deselect, then reselect...). I *don't* think it necessarily waits until exporting is finished, - probably just seems that way, since it's kept pretty busy by exporting (?).

PS - I have a feature request for a "goosing" function, so plugin can force refreshing of externally changed photos:

http://feedback.photoshop.com/photoshop_family/topics/lightroom_sdk_function_to_refresh_thumbnail_and_or_loupe_display

Sorry I couldn't be more help,

Rob.

返信数 1

areohbee
areohbee解決!
Legend
November 1, 2012

Regarding point #1:

Not sure I can tell you anything you don't already know:

Exports within a single session are serial.

If you want parallel exports you need to create multiple export sessions.

Some performance improvement can be had that way, but don't get your hopes up too high.

Regarding point #2 - Lr does seem to update stuff on it's own schedule, I've tried various things to convince it to update stuff, but with only marginal success (e.g. deselect, then reselect...). I *don't* think it necessarily waits until exporting is finished, - probably just seems that way, since it's kept pretty busy by exporting (?).

PS - I have a feature request for a "goosing" function, so plugin can force refreshing of externally changed photos:

http://feedback.photoshop.com/photoshop_family/topics/lightroom_sdk_function_to_refresh_thumbnail_and_or_loupe_display

Sorry I couldn't be more help,

Rob.

PaulWaldo作成者
Known Participant
November 2, 2012

Thanks for the reply, Rob.  I tested and multiple export sessions do allow me to fry eggs on my machine.  Thanks!

areohbee
Legend
November 2, 2012

In theory, you shouldn't see much improvement by having multiple export sessions, because, in theory, a single export session should consume 100% of all cores most of the time. If you do see a lot of improvement, then it could be due to the "less-than-optimal" processor utilization that seems to plague some machines.

I get only marginal improvement in throughput via parallel exports.

I've heard here and there that Lightroom downthrottles cpu consumption during rendering so UI stays responsive, but it shouldn't have to do that, and it doesn't do that on my machine.

Cheers,

Rob