Commit 7723f50
committed
Build: Don't modify CMAKE_C_FLAGS_* if specified
The build system originally force-enabled the maximum optimization level
(-O3) with GCC because it significantly improved the performance of the
C Huffman encoder on x86 platforms. Since libjpeg-turbo 1.5.x, the
Huffman encoder has been SIMD-accelerated on x86 and Arm platforms, and
in my testing on various Intel CPUs, the difference between -O2 and -O3
is no longer statistically significant. However, on certain Arm CPUs, I
observe that grayscale decompression slows down by 16-27% with -O2 vs.
-O3. Although modern versions of CMake use -O3 as the default
optimization level for Release builds, -O2 is still the default
optimization level for RelWithDebInfo builds. Thus, I am reluctant to
change the default behavior of our build system. However, referring
to #815, some users observe better performance with -O2 vs. -O3 on other
Arm CPUs, so the build system needs to allow users to override the
default behavior.
Closes #8151 parent d163c99 commit 7723f50Copy full SHA for 7723f50
1 file changed
+23-8Lines changed: 23 additions & 8 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+23-8Lines changed: 23 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
7 | 16 | |
8 | 17 | |
9 | 18 | |
| ||
428 | 437 | |
429 | 438 | |
430 | 439 | |
431 | | - |
432 | | - |
433 | | - |
| 440 | + |
| 441 | + |
| 442 | + |
| 443 | + |
| 444 | + |
434 | 445 | |
435 | 446 | |
436 | 447 | |
437 | 448 | |
438 | 449 | |
439 | 450 | |
440 | 451 | |
441 | | - |
442 | | - |
443 | | - |
| 452 | + |
| 453 | + |
| 454 | + |
| 455 | + |
| 456 | + |
444 | 457 | |
445 | | - |
446 | | - |
| 458 | + |
| 459 | + |
| 460 | + |
| 461 | + |
447 | 462 | |
448 | 463 | |
449 | 464 | |
|
0 commit comments