News for hackers. Stuff that matters.
Re:Beautiful branchless binary search by xmcqdpt2 on Friday April 28, 2023 @09:00AM (#35740748)
If your PGO program ends up in a situation which is the opposite of that you profiled, couldn't you end up with vastly worse performance than a non-optimized program?

I've always felt uncomfortable about PGO for more complex programs because of this.

Re:Beautiful branchless binary search by eklitzke on Friday April 28, 2023 @02:17PM (#35745100)
Right, this is why you should use AutoFDO nowadays not PGO. With AutoFDO you occasionally (e.g. in prod this might be something like record for 1s on average every 300s) record what branches were taken using perf-record from prod binaries, and then feed this back to the compiler.