r/cpp • u/ericbrumer MSVC Dev Lead • Jun 16 '26
Boosting Adobe Photoshop’s Performance with MSVC and SPGO - C++ Team Blog
https://devblogs.microsoft.com/cppblog/boosting-adobe-photoshops-performance-with-msvc-and-spgo/We recently announced that sample-based profile-guided optimizations are available for use with MSVC. Here's how Adobe used peak performance switches and SPGO to boost Photoshop's performance on CPU-bound operations, yielding a 20% boost on Photoshop benchmarks on x64 (13% boost on ARM64).
Sample-based profiling, as opposed to instrumentation-based sampling, enables these kinds of turbo-charging optimizations to occur with a scalable engineering approach: no additional build configurations, and count collection occurs on optimized binaries (as opposed to slow-running instrumented binaries).
If you're interested in trying SPGO out, here are some links:
- Previous thread: https://www.reddit.com/r/cpp/comments/1tig36r/introducing_sample_profile_guided_optimization_in/
- SPGO tutorial: https://aka.ms/spgo/tutorial
- SPGO blog: https://aka.ms/spgo/blog
11
u/ReDucTor Game Developer | quiz.cpp-perf.com Jun 16 '26
PGO builds tend to add a bunch of compile overhead, one thing that would be great to see is easier to consume reports for what code was particularly bad so then people could do things like using likely/unlikely annotations and even report common patterns that the compiler fails with so potential heuristics in the compiler could be added to reduce the reliance on PGO, for example clang already has some heuristics for branch likely hood but MSVC its fells more like the only heuristics without PGO is does a branch have noreturn or does it throw and now the recent likely/unlikely.
This would particularly benefit things like optimized dev builds which dont rely on PGO
35
u/ztwizzle Jun 17 '26
I would have appreciated some more details on what they were able to optimize and how they went about optimizing the code while using SPGO to guide them. This blog post made me aware of SPGO (which sounds neat) but it was basically "SPGO lets you profile release binaries, we taught Adobe how to use it, they achieved a 20% speedup [no details on testing methodology]" which isn't really enough information to be a useful case study.
19
u/R3DKn16h7 Jun 17 '26
The post says nothing though. Ah, they used the tool and got this result. And the benchmark is also a bit sad, with 20% performance measured, but where? how? what part of the software? what specific actions where taken.
I know is proprietary code, but more details would be good, otherwise is just empty marketing.
Like just switching /GL did get what? 1%? 2%?
4
u/JuanAG Jun 17 '26
What are exactly "CPU-bound operations"
And what times are we talking about? 20% faster in mili seconds is nice, in ns not so much since you get rid of the stall/lock of whatever micro operation but in the big scheme of things the improvement could not even reach 1% faster
1
u/Tringi github.com/tringi Jun 17 '26
I wish even normal PGO worked somewhat like this, or more somewhat like Dynamic Debugging.
What I mean is building it with some
/DynamicPGOflag, which would generate two files:I could have perfectly performant EXE and give it to the customer. Or I could run it through Ctrl+F5 in Visual Studio: That would run the instrumented code, generating .pgd data for next recompilation.
Just a thought from someone too lazy to maintain multiple project configurations.
1
u/barfyus Jun 18 '26
Noticed that with SPGO, our code started to calculate a wrong CRC checksum (it uses Boost CRC library, namely, the
crc_basicclass. "Trained" with one set of parameters and run with different set of parameters).Now I can imagine a myriad of other places with bad code after enabling SPGO. How can it even be trusted?
-4
u/feverzsj Jun 17 '26
When it's already 200% slow, 20% boost won't be sensible.