-
Notifications
You must be signed in to change notification settings - Fork 264
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
[Bug]: Windows LLVM binaries compile extremely slowly #1971
Comments
I confirmed that compiling curl using ndk r25 takes 6 seconds, whiling using ndk r26 takes 3 minutes. |
I am not sure if I reproduced the same problem. And the time for compiling a c file in libcurl is similar to the time loading clang.exe. So on my windows machine, only clang-r450784d and clang-r450784d1 are loaded significantly faster than other versions. I feel it may be something universal, or something special on my machine (like executable firewall). |
I'm not sure if I did this right, but I used this command via
When I ran it for the r26.1.10909125 build, I got this this the first time I ran it:
The second time, and every time after that though, I got times similar to this:
I tried this in the r26.1.10909125 folder with the 17.0.2 I downloaded straight from LVVM and I got basically the same result; a slow execution, then always fast after that. I went to the 25.0.8775105 folder and tried it there, but always got times like this:
This happened even on the first execution. So it does seem to be behaving differently, but it's not clear why. It's also odd because this seems to suggest that it caches the executable after the first execution, speeding it up after that. Assuming my timing test is legit! If there's a better way to perform the timing let me know and I'll try it. |
I finally get over the execution cache problem. real 0m0.215s =================================================== After that, I can finish compiling curl using ndk26 within 7 seconds. C:\Users\yabinc\bugs\clang_slow\curl-8.4.0>echo start time 15:32:39.66 So I can't reproduce your slow compilation problem. Maybe you can try restarting your machine, or try another windows machine? |
My machine has been rebooted a few times since then; I'll give it a try there and then find another Windows machine to try it on as well. |
@yabinc I'm seeing the same result you are now, it's building curl as fast as NDK v25. I'm sorry to have wasted your time here! Any idea what caused this? It sounds like it was somehow not refusing to cache the The main thing is the problem isn't happening though -- thanks for looking at this for me! |
I have the same guess: Windows refused to cache clang.exe in ndk r26 before reboot. The problem is also slow compiler launch time. And the fix they had was adding exclusive rules for Windows Defender. |
Description
There seems to be something wrong with the Windows LLVM binaries (specifically, clang.exe, clang++.exe, maybe the other clang executables).
I posted a comparison of timings from builds on my machine in the discussion forum (#1967). The easiest way to replicate this is to build anything substantial, an excellent case being curl.
In the above example, I used Android Studio to install the NDK & CMake, but they could come from anywhere
The CMake step should take a long while. The build step (6) should also be pretty obviously slow. If you set the NDK version to 25.0.8775105 and repeat the steps, you should see a significant difference in speed.
As a side note, a friendly user on the LLVM forum suggested I try replacing the clang.exe & clang++.exe from the 26.1.10909125 LLVM prebuilt folder with the ones from the official LLVM 17.0.2 release, so I gave that a try. When I did that, the build time was similar or faster than with 25.0.8775105 -- so the problem seems to lie with the LLVM windows binaries that ship with 26.1.10909125.
Upstream bug
No response
Commit to cherry-pick
No response
Affected versions
r26
Canary version
No response
Host OS
Windows
Host OS version
10.0.19045.3570
Affected ABIs
armeabi-v7a, arm64-v8a, x86, x86_64
The text was updated successfully, but these errors were encountered: