Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The official Windows builds are much slower than the static Clang builds #2268

Open
esator opened this issue Mar 6, 2023 · 8 comments · May be fixed by #3368
Open

The official Windows builds are much slower than the static Clang builds #2268

esator opened this issue Mar 6, 2023 · 8 comments · May be fixed by #3368
Assignees
Labels
building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone

Comments

@esator
Copy link

esator commented Mar 6, 2023

Release builds for Windows are much slower than static Clang builds, especially for fast speeds

ProcProfile64:
clang v0.9.0 [cjxl e1 lossless]
119,771,153 -> 52,094,805: 43.49%. Cpu 349 mb/s (0.327 sec), real 318 mb/s (0.359 sec) = 91%. ram 401144 KB, vmem 569556 KB

git build v0.8.1 [cjxl e1 lossless]
119,771,153 -> 51,493,245: 42.99%. Cpu 78 mb/s (1.453 sec), real 78 mb/s (1.452 sec) = 100%. ram 402340 KB, vmem 569940 KB

@mo271 mo271 added building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone labels Mar 15, 2023
@AlifianK
Copy link

I noticed this too. Binaries produced from MSVC are a lot slower than clang build. Also, clang 16 builds are faster than clang 15.

@mo271
Copy link
Member

mo271 commented Mar 4, 2024

Can you check if this is still the case with version 10.1? We reduced the number of allocations, which could explain some of those speed differences.

@AlifianK
Copy link

AlifianK commented Mar 4, 2024

There are a little bit of differences in higher efforts, but lower efforts are more pronounced, but probably fast enough to not be noticed.

0x0.st/H7us.txt

veluca93 added a commit to veluca93/libjxl that referenced this issue Mar 4, 2024
@veluca93 veluca93 linked a pull request Mar 4, 2024 that will close this issue
@veluca93
Copy link
Member

veluca93 commented Mar 4, 2024

There are a little bit of differences in higher efforts, but lower efforts are more pronounced, but probably fast enough to not be noticed.

0x0.st/H7us.txt

Would you be able to verify whether the build artefacts in https://github.com/libjxl/libjxl/actions/runs/8146246627 solve the issue?

@AlifianK
Copy link

AlifianK commented Mar 5, 2024

v0.10.1 release and Github artifacts binaries comparison
bench_github.txt
Clang-cl build is faster at e1, but then is slightly slower and sometimes slightly faster. Maybe there are some commits that slowed it down.

I compared my local MSVC and Clang-Cl build with the same commit, and the result is consistent, with Clang-Cl being faster.
bench_local.txt
No additional compiler flags, just -DCMAKE_BUILD_TYPE=Release

@veluca93
Copy link
Member

veluca93 commented Mar 5, 2024

What CPU are you running this on?

@AlifianK
Copy link

AlifianK commented Mar 5, 2024

Intel Core i5-7200U

Edit: cmake configurations
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_BENCHMARK=ON -DJPEGXL_ENABLE_OPENEXR=OFF -DJPEGXL_ENABLE_TCMALLOC=OFF -DJPEGXL_ENABLE_VIEWERS=OFF -DCMAKE_TOOLCHAIN_FILE=C:\\Users\\A\\scoop\\apps\\vcpkg\\current\\scripts\\buildsystems\\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static --fresh ..

@AlifianK
Copy link

AlifianK commented Mar 5, 2024

There are a little bit of differences in higher efforts, but lower efforts are more pronounced, but probably fast enough to not be noticed.
0x0.st/H7us.txt

Would you be able to verify whether the build artefacts in https://github.com/libjxl/libjxl/actions/runs/8146246627 solve the issue?

Looking at the configure step of the Github actions, it seems like it was still being compiled by MSVC, not Clang-Cl. That explains this discrepancy.

Clang-cl build is faster at e1, but then is slightly slower and sometimes slightly faster. Maybe there are some commits that slowed it down.

https://github.com/libjxl/libjxl/actions/runs/8146246627/job/22264345808

-- The C compiler identification is MSVC 19.29.30154.0
-- The CXX compiler identification is MSVC 19.29.30154.0

If the build system is not specified, CMake is defaulted to MSBuild. MSBuild silently ignores the -DCMAKE_CXX_COMPILER flag, only Ninja accepts it.

@eustas eustas self-assigned this Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants