Do You Wish Lightroom Was Quicker? Adobe Does Too

Khalai

In the absence of light, darknoise prevails...
May 13, 2014
714
0
39
Prague
EdelweissPirate said:
That's not to say that Lightroom doesn't have issues. It does, but I don't pretend to know the root cause of those problems. For example, as far as I can tell, exporting JPEGs and building 1:1 previews (which are basically the same thing) should be embarrassingly parallel or nearly so. Yet, as the plot Diko posted shows, Lightroom doesn't efficiently use more than four CPUs for these tasks. In other words, building 1:1 previews should take half as much time with eight physical cores as it does with four, but instead it takes nearly the same amount of time.

According to Puget Systems, exporting images is about the only thing which goes as much parallel as it can, yielding .97 efficiency, while other tasks are much more problematic.

ActionParallel Efficiency (1 is perfect)
Importing images from USB.00
Exporting images to disk.97
Convert from RAW to DNG.69
Generate 1:1 Previews.77
Generate Smart Previews.51
Create HDR image.60
Create Panorama image.44
Facial Recognition.20
 
Upvote 0
Yeah, not so much. Puget Systems is calculating not the theoretical parallel efficiency of each task but rather the efficiency of Lightroom as you add processors. Some tasks are inherently parallel while others are inherently serial.

Moreover, Puget Systems is calculating the efficiency only at the first few processors. None of those curves shows Puget Systems' calculated efficiency for long for long. When I say that exporting images and generating previews should be embarrassingly parallel, I mean that the time for the task should fall continuously with the number of processors.

All of the Puget Systems curves flatten out after somewhere between 2-8 cores, depending on the task. I'm suggesting that for generating 1:1 previews and exporting images, the line should have (theoretically) a quadratically decreasing slope.

Exporting images doesn't "go as much parallel as it can," in your words. The speedup is quasi-linear but then drops off dramatically. Their task takes 200 seconds with three cores and about 100 seconds with six cores. So far, so good. But then twelve cores should take 50 seconds, and their plot makes it look more like 90 seconds. So the parallel efficiently may be 0.97 for the first few processors, but it drops off to almost zero after that.

Realistically, the speedup in Puget Systems' export test may be limited by disk or memory bandwidth, which is understandable. But generating 1:1 previews is (insofar as I understand it) should be at least as parallelizable (so to speak), and yet Lightroom doesn't reflect that. This might be an area where speeding up Lightroom is straightforward, but I don't think we know enough about the problem to say for sure.
 
Upvote 0

Khalai

In the absence of light, darknoise prevails...
May 13, 2014
714
0
39
Prague
EdelweissPirate said:
Yeah, not so much. Puget Systems is calculating not the theoretical parallel efficiency of each task but rather the efficiency of Lightroom as you add processors. Some tasks are inherently parallel while others are inherently serial.

Moreover, Puget Systems is calculating the efficiency only at the first few processors. None of those curves shows Puget Systems' calculated efficiency for long for long. When I say that exporting images and generating previews should be embarrassingly parallel, I mean that the time for the task should fall continuously with the number of processors.

All of the Puget Systems curves flatten out after somewhere between 2-8 cores, depending on the task. I'm suggesting that for generating 1:1 previews and exporting images, the line should have (theoretically) a quadratically decreasing slope.

Exporting images doesn't "go as much parallel as it can," in your words. The speedup is quasi-linear but then drops off dramatically. Their task takes 200 seconds with three cores and about 100 seconds with six cores. So far, so good. But then twelve cores should take 50 seconds, and their plot makes it look more like 90 seconds. So the parallel efficiently may be 0.97 for the first few processors, but it drops off to almost zero after that.

Realistically, the speedup in Puget Systems' export test may be limited by disk or memory bandwidth, which is understandable. But generating 1:1 previews is (insofar as I understand it) should be at least as parallelizable (so to speak), and yet Lightroom doesn't reflect that. This might be an area where speeding up Lightroom is straightforward, but I don't think we know enough about the problem to say for sure.

Still useful comparision to a degree. Not many people have more than eight core CPUs back home. I don't think that E5-2699v4/v5 is that prolific in home PCs :)
 
Upvote 0
Nov 4, 2011
3,165
0
@edelweiss: i thought i had made it clear that i dont like both: 1. lr using a database at all and 2. using a grossöy underperforming implementation of a database. i think it is proven beyond reasonable doubt, that LR performance problems - even on powerful hardware - are rooted in its database, since other raw converters/image editors - anything from canon DPP to Capture 1 pro to Adobe Bridge - does NOT have those performance problems.

i am fine with LR's (ACR) raw conversion (even though Canon DPP does an even better job on canon raws), i do like LR user interface and the editing functionality. While limited it is all i need. Only thing i don't like and don't need is the database. so for me the preferred solution would be a well performing "LR lite" with identical raw converter and image editor functionality but without database. i have no problem to find image files in windows thanks to my well thought out and disciplined file and folder naming scheme and structure. firthermore there are apps available to conduct AI-based content specific search for images. no manual image tagging needed. no lightroom database needed. fast, efficient, automatic.
 
Upvote 0

LDS

Sep 14, 2012
1,771
299
AvTvM said:
i think it is proven beyond reasonable doubt, that LR performance problems - even on powerful hardware - are rooted in its database, since other raw converters/image editors - anything from canon dpp to capture 1 pro to adobe bridge - does NOT have those performance problems.

Here you can find a description of the LR architecture: http://www.troygaul.com/LrExposedC4.html. it's not up to date, but AFAIK it didn't change much since then.

It's not proven that SQLite is the issue. Your empirical observation is based on the fact that LR employs a database, the others don't, so the culprit must be the database. Unluckily, there are many other not so obvious details to take into consideration - i.e the use of Lua by LR.

SQLite is used in many products (see here https://sqlite.org/famous.html) - if it had so many performance issues, it would have been already replaced by something else.

While I would like LR could also support a stand-alone database (so it could be run on a different server, and several LR clients could connect and work on the same catalog...), it would be much heavier and difficult to install for single use than the one actually used by LR.

Anyway, what is important is to exactly pinpoint where performance issues arise. There are tools to measure quantitatively software performance and identify precisely where bottlenecks are. This is the only way to ensure the proper piece of software is optimized - but it's something only Adobe can do with the proper level of detail.

The fact they're asking user what they believe is a priority will tell them where to start to look at.
 
Upvote 0
Jul 28, 2015
3,368
570
I think there are two things driving this - firstly functionality was given a priority over speed and LR has now reached a stage of rapidly diminishing returns on the functionality. More functions mean more data in xmp files mean more data to handle.
The rise of programs like Photomechanic and Breezebowser mean professionals are using those systems to cull photos but also as digital management because they are so much quicker for their purpose and that is Adobe's next step.

Which actually begs the question of where people want the speed. If they want the speed of review and culling, then there is Photomechanic approach where you could go into a review module where you review the embedded raws for sharpness/composition and the only data you apply are 'delete' flag (and maybe a 'rating') and when you have been through your complete ingest of 5,000 photos you press a button to update the library. Then it goes as it is now.

Some people complain about the time it takes to apply edits and that would be completely different set of issues - but I have occasions where LR is quick and others where it is very slow and I wonder if that is due to other things the computer is doing rather than LR itself.
 
Upvote 0
Nov 4, 2011
3,165
0
Mikehit said:
I think there are two things ...
... speed of review and culling ...
... time it takes to apply edits ...

I agree. Where I don't agree is, why has MIGHTY Adobe up to today NOT been able (or willing) to provide
1. an IMPORT Module in LR, that is every bit as simple , fast and painless as PhotoMechanic?
2. An EDIT module that performs fast by fully utilizing today's hardware (multi-core/Threaded CPUs, lotsa RAM, blazingly fast NVME SSDs etc.)

My explanation: Adobe has been resting on their laurels or rather on their big fat corporate ass and rather than on product development they are primarily focussed on coercing as many users as possible into their rental subscription scheme and raking in the cash.
 
Upvote 0
Jul 28, 2015
3,368
570
AvTvM said:
Mikehit said:
I think there are two things ...
... speed of review and culling ...
... time it takes to apply edits ...

I agree. Where I don't agree is, why has MIGHTY Adobe up to today NOT been able (or willing) to provide
1. an IMPORT Module in LR, that is every bit as simple , fast and painless as PhotoMechanic?
2. An EDIT module that performs fast by fully utilizing today's hardware (multi-core/Threaded CPUs, lotsa RAM, blazingly fast NVME SSDs etc.)

My explanation: Adobe has been resting on their laurels or rather on their big fat corporate ass and rather than on product development they are primarily focussed on coercing as many users as possible into their rental subscription scheme and raking in the cash.

Alternative reading:
You don't change architecture and add functionality at the same time. They saw functionality as the more important to keep ahead of the competition. Now that is in place the architecture is coming under the spotlight more than it was before.
A company like Adobe does not get to be where it is (and maintain that position) by incompetence or luck - and just because they don't agree with you. or you don't understand their decisions, doesn't mean they don't know what they are doing.
 
Upvote 0

LDS

Sep 14, 2012
1,771
299
AvTvM said:
1. an IMPORT Module in LR, that is every bit as simple , fast and painless as PhotoMechanic?

The import module of LR does more - it can generate different types or previews, convert to DNG, apply presets, etc. Photomechanics does less, does it better, and cost as much as LR. It's a much more focused applications - which justify its prices only if you need that focus. Probably when USB 2.0 and spinning disk were the norm, the LR code looked adequate - now with USB 3.0/Thunderbolt and SSD disks, it may be not.

AvTvM said:
2. An EDIT module that performs fast by fully utilizing today's hardware (multi-core/Threaded CPUs, lotsa RAM, blazingly fast NVME SSDs etc.)

Note than not everybody yet has twelve core, 128G of RAM and NVMe disks :) LR is still a $150 application, often sold in bundle with something else, and could end to be used on far less powerful machines. You may need to find a balance between the system requirements, and performance. If it was aimed only at 7D/5D/1D users (or equivalent cameras from other brands) maybe they could think they have matching PCs - but there's a lot of less expensive cameras users, with less powerful PCs, among the LR users as well.

AvTvM said:
My explanation: Adobe has been resting on their laurels

It's highly probable - as long as a product sell well enough there are little commercial reasons to invest a lot in modifying it deeply, because there are risks there will be more new bugs to chase and fix, and stability issues (just look at GPU support...). Look at how Canon itself is often conservative in new models - it's the same approach.

When competitors get close, or surpass you, if you're not stupid you understand the time has come for the required changes, and risks are balanced by the risk of losing market share.
 
Upvote 0
Nov 4, 2011
3,165
0
LDS said:
AvTvM said:
2. An EDIT module that performs fast by fully utilizing today's hardware (multi-core/Threaded CPUs, lotsa RAM, blazingly fast NVME SSDs etc.)
Note than not everybody yet has twelve core, 128G of RAM and NVMe disks :) LR is still a $150 application, often sold in bundle with something else, and could end to be used on far less powerful machines. You may need to find a balance between the system requirements, and performance. If it was aimed only at 7D/5D/1D users (or equivalent cameras from other brands) maybe they could think they have matching PCs - but there's a lot of less expensive cameras users, with less powerful PCs, among the LR users as well.

No, not everyone has a fast PC. But it won't matter with LR anyways. because LR does NOT take any advantage of powerful hardware, when it is there. LR lets it sit and idle ... that's the second aspect of the LR performance problem we are discussing here. The other aspect is the poorly performing, unnecessary database (both concept and implementation).

There is simply no excuse. Adobe said, with CC cloud stuff and monthly payments will come regular ongoing improvements. Not true. Clear lie.
 
Upvote 0
Jul 28, 2015
3,368
570
LDS said:
AvTvM said:
My explanation: Adobe has been resting on their laurels

It's highly probable - as long as a product sell well enough there are little commercial reasons to invest a lot in modifying it deeply, because there are risks there will be more new bugs to chase and fix, and stability issues (just look at GPU support...). Look at how Canon itself is often conservative in new models - it's the same approach.

is it the same approach? AvTvM is talking (as he usually does) about how the company is complacent and does not need to develop so just sits there raking the money in. You seem to be talking about the same thing I was on how Adobe (and Canon) choose to apply their R&D budget - and because it does not chime with how AvTvM want them to spend it he takes this as laziness.
 
Upvote 0

LDS

Sep 14, 2012
1,771
299
Mikehit said:
is it the same approach? AvTvM is talking (as he usually does) about how the company is complacent and does not need to develop so just sits there raking the money in. You seem to be talking about the same thing I was on how Adobe (and Canon) choose to apply their R&D budget - and because it does not chime with how AvTvM want them to spend it he takes this as laziness.

It is also true that commercial entities like easy money - not pleasing users if they don't see much more profits, and since the mantra "maximizing stakeholders value" was hammered into managers heads at MBAs, they need really good reasons to increase R&D beyond what they believe is adequate to maintain market share when they're already the leaders.

And since often the "stakeholders" are the CEOs and other board people, they will happily funnel money in dividends and buybacks instead of R&D. Some understand how to balance that well enough, others don't, and their company may go down the sink.
 
Upvote 0
AvTvM said:
@edelweiss: i thought i had made it clear that i dont like [Lightroom] using a grossöy underperforming implementation of a database.

Yeah...this is why I suspect you don't understand databases in general and SQLite in particular. SQLite is a stripped-down, speedy database. I understand that you think a database is unnecessary, but this is one of the fastest Adobe could possibly have used. SQLite is open-source; Adobe didn't implement it—they just used it. There's a big difference.

I'm not trying to make fun of you for not knowing these things. It's just that in order for your point to be valid, it requires a falsehood (that SQLite is an inherently slow database) to be true.

But let's put that aside for now. What operation do you think Lightroom is doing via its database that would be so much faster without one? I'm not asking what you find slow about Lightroom, though there are many aspects that could be faster. I'm asking what low-level operation you imagine is slowed down by Lightroom's use of SQLite.

I agree with LDS that the fact that the UI is written largely in Lua might have something to do with it. In most cases, Lua code is run in a user-transparent virtual machine, and that may be responsible for a lot of the UI lag. But I don't know enough about how Lightroom uses Lua to say for sure...Adobe could be using some fancy Lua-to-compiled-code maneuver (not standard compiled Lua bytecode) that's beyond my ken.


[quote author=AvTvM]i think it is proven [/quote] I don't think that word means what you think it means.

beyond a reasonable doubt, that LR performance problems - even on powerful hardware - are rooted in its database, since other raw converters/image editors - anything from canon DPP to Capture 1 pro to Adobe Bridge - does NOT have those performance problems.

This is a straightforward post hoc fallacy. Again, I'm not mocking you here; I'm just trying to point out that Lightroom's speed problem (which is absolutely real) isn't intrinsic to its use of a database.

[quote author=AvTvM]so for me the preferred solution would be a well performing "LR lite" with identical raw converter and image editor functionality but without database. [/quote]
Then why not just use ACR plus Photoshop?


[quote author=AvTvM] i have no problem to find image files in windows thanks to my well thought out and disciplined file and folder naming scheme and structure.[/quote]

Whether you understand it or not, your system is a database (albeit a comparatively slow one requiring a meatspace interpreter).

[quote author=AvTvM]firthermore there are apps available to conduct AI-based content specific search for images. no manual image tagging needed. no lightroom database needed.[/quote]

As others have pointed out, all of these apps have their own databases. You've taken the database out of Lightroom, but you've still got the database in your workflow.
 
Upvote 0
[I switched to computer engineering about 3/4 of the way through my CS degree, so while I have an adequate grasp of algorithmic complexity, my professional experience is all in hardware design, not software.]

Lightroom's scaling suggests to me that Adobe did the 'hard' work of making a multi-threaded RAW processor, but not the comparatively 'easy' work of spawning mutliple instances of it to achieve near-linear speed-up on embarrassingly parallel tasks. Granted, there would be some overhead for inter-process communication and they might have to serialize database access, but the heavy lifting is all in the image processing. And they don't appear to have done any work to predict users' future actions and prepare for them in advance.

Export to Disk is the only test that Puget did which exhibits reasonably linear scaling, and even then only out to 8-10 cores. I would have liked to see Puget re-run their test with two simultaneous exports of 40 images each, rather than one export of 80. Does that improve the scaling, perhaps by forcing LR to spawn a second worker thread? I haven't been able to get good data running such tests myself, but I only have 4 physical (+4 logical) cores to play with, so the fact that LR export scales reasonably linearly to that point would tend to obscure any advantage I might see from the hypothetical second worker thread.

Convert to DNG should be just as embarrassingly parallel as Export, but its scaling behavior is quite different. Speed-up from the second core is roughly linear, but the third and fourth core do very little, and beyond that there's negligible additional scaling. Conceptually, Convert is the same render-to-bitmap operation as Export, followed by encode-to-DNG rather than encode-to-JPG. However, as we can see from the fact that Convert is ~3x as fast on 1-2 cores as Export, the algorithm appears to be avoiding a lot of the work of manipulating image data that Export does. Since the disk bandwidth is quite low (tens of MB / sec maximum) in both cases, either LR is phenomenally inefficient at file access (this seems very unlikely since there's no obvious reason they wouldn't load an entire file into RAM and then flush an entire file to disk when done), or the bottleneck is elsewhere. On a system with 20MB of cache, nearly able to cache an entire RAW image from Puget's test, it seems unlikely that memory bandwidth is the limiting factor.

Generate 1:1 Previews and Generate Smart Previews both have similar scaling limits to Convert: peak performance is reached at about 4 cores, with best performance being only 2-3x as high as single-core performance.

Since there aren't any obvious resource limitations to better performance (the tasks are not CPU bound, not disk I/O bound, probably not memory bandwidth or latency bound, and don't have clear inter-process communication or coordination limits). All of which leads me to believe that LR was architected to minimize latency (it tries to process a single image as fast as it can, via a multithreaded rendering process) rather than maximize throughput (operations per hour). Though it's pure speculation on my part, I would guess that rendering is probably pipelined (eg demosaic -> user edits -> noise reduction -> sharpen - and yes, I realize that's not the order LR does those steps: this is an example of pipelining) and scaling is limited by the slowest pipeline stage and the total number of pipeline stages.

(It will be interesting when AMD's Threadripper CPUs get into users' hands to see how LR scaling changes in response to the different hardware behavior (such as markedly lower single-threaded memory bandwidth, but much higher multithreaded bandwidth; or the very different cache organization and performance characteristics) that the new platform brings.)

But despite this hypothetical focus on latency minimization, there seems to have been little to no effort at latency hiding. For example, when I'm viewing a photo in the library module, LR doesn't seem to pre-render the next and previous photos so I can 'instantly' move forward or back in the film strip. It doesn't pre-load everything it would need if I were to flip to the develop module to make some quick edits. All three of those operations are high-probability guesses as to what my next action will be, and are good targets for trading power efficiency for higher productivity.

I would like to see Lightroom make use of idle compute power so that repetitive, predictable operations are fast because LR has already anticipated and completed the thing I'm about to ask it to do.
 
Upvote 0

LDS

Sep 14, 2012
1,771
299
haversian said:
On a system with 20MB of cache, nearly able to cache an entire RAW image from Puget's test, it seems unlikely

What 20MB cache are referring to? The CPU one?

AFAIK, when a RAW is loaded into memory it gets far more RAM than its disk size. The Adobe document I posted above says that a 40Mpx image can take 240MB of RAM, and between 0.5 and 1GB with edits applied. Even halved for a 20Mpx image, they are still far more than 20MB.

Anyway, the CPU L3 cache is shared across all cores, it is shared across all the applications running on the PC (including the OS itself and the many background services) - and Lightroom has very little control on what is in the cache at any given time - but optimizing the code for cache access (I'll avoid to go too technical in this forum), and hope :)

Actually, more parallel executions could mean more CPU cache contention - depending on what the processes are doing.

Increasing the Camera Raw cache - albeit disk based, but under full LR control, could improve performances, because LR can skip some processing stages if the image is cached.
 
Upvote 0
Cheers, Graham...I'm glad you liked the turn of phrase.

LDS, you're right that Canon raw files are compressed. I have a 7D (MK I) and its ~18 MP images should decompress from raw to about 31.3 MB in memory:

5184 * 3456 pixels * 14 bits per pixel = 250822656 Bits ~ 31.3 megabytes

The 5D MK IV has these specs:

6720 * 4480 pixels * 14 BPP = 421478400 bits ~ 52.7 MB

Many editing operations are straight-up transforms of the raw-image matrix, so you could cache the results of each editing step with an uncompressed image roughly the same size as the original raw file. If I'm right about that, then to a first approximation, a 5D MK IV raw image with about 15 cached, rendered edits should take about 1 GB of RAM to store when using the editing module.

That jibes with the Adobe document you posted. CPUs don't have nearly that much cache on silicon, of course. But many serious LR users have 32-64 GB of RAM, and in such cases LR would have enough resources to store quite a few pre-rendered images in RAM.

Haversian, thanks for the informed commentary. I think you're right that LR does zero (or nearly zero) speculative rendering to hide latency. It seems like such low-hanging fruit for the developers that I can't help wondering whether it was a design decision to prevent LR from seeming to "churn" in the background while seemingly doing nothing. Being more aggressive about speculative execution would certainly make better use of 6+ physical CPUs than LR does now.
 
Upvote 0

Khalai

In the absence of light, darknoise prevails...
May 13, 2014
714
0
39
Prague
LDS said:
Increasing the Camera Raw cache - albeit disk based, but under full LR control, could improve performances, because LR can skip some processing stages if the image is cached.

I have allocated 30 GB of my Samsung 950 Pro NVMe PCIe drive for caching, while having 32 GB RAM as well. Doesn't help much really...
 
Upvote 0

LDS

Sep 14, 2012
1,771
299
EdelweissPirate said:
LDS, you're right that Canon raw files are compressed. I have a 7D (MK I) and its ~18 MP images should decompress from raw to about 31.3 MB in memory:

5184 * 3456 pixels * 14 bits per pixel = 250822656 Bits ~ 31.3 megabytes

You forgot the color planes :) After demosaicing you get an image with more than the 14 bit per pixel of the pure pixel DR.

Let's remember LR uses a slightly modified version of ProPhoto RGB color space, which uses more than the 24 bit per pixel than sRGB (which would be rounded anyway to 32 bit because of the way CPUs work, using half a byte would make computations much more complex).

To preserver each color range, at least, LR will need to use 16 bit per color per pixel which means 48 bit per pixel - which I guess will be rounded to 64, depending on how LR encodes those data in memory, but again usually CPU instructions are optimized to work on 32/64/128 bit values.

So your 7D image would be 68MB for 32 bit, and 136 for 64 bit. That would become 114/229 for the 5D4, which is in line with what the Adobe presentation says, and makes me think LR uses 64 bit per pixel.

That also means there's a question on how good is LR in exploiting the CPU advanced instructions (the various versions of MMX, SSE and AVX) designed to improve the performance of this kind of processing (even without using the GPU) - although again it has to cope with the fact that not all the supported CPUs may have the latest ones.

The fact that the system requirements (https://helpx.adobe.com/lightroom/system-requirements.html) doesn't specify much about the processor, makes me think LR only uses the least common denominator.
 
Upvote 0
Thanks, LDS, for expanding on my post and filling in the stuff I missed. I'm interested in these things, but my field is mechanical engineering, not computer science or software engineering.

A quick Google search implies that Lightroom is only compiled against SSE2 and nothing later. On the other hand, I think the real question is: what instruction sets is ACR compiled against? I'd expect it's the same, but maybe others here have better information.

Thanks again for correcting my post.
 
Upvote 0