-
Notifications
You must be signed in to change notification settings - Fork 3
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
Binaries are ~100x slower #1
Comments
Hi Frank, |
I don't have any code in this race, but just for drive-by troubleshooting: Is one perhaps configured for software floating point and another for hardware FP? use gcc -v and watch the link stage to see if one is getting softfp and one hardfp. Is one configured with a whacked out timer value? Is your delay(1) is sleeping for the wrong amount of wall time? If so, get to the bottom of that first as it indicates a library problem. If the library has the wrong concept of wall time, relying on that in your benchmark will be a problem. Can you use both versions to compile and run dhrystone? That gives a number that's a gross estimate of integer computing efficiency. It's unlikely you'll see 100x here. Your report is really too vague for action by a compiler group. A self-contained (small) test case would be really helpful to analyze. |
Hey @yesitsme007!
First of all, thanks for taking the trouble to get toolchain running on the Mac.
I noticed that programs compiled with this toolchain run about 100 times slower than programs compiled on Linux/Windows. Can you confirm this?
With both the Arduino and the normal SDK, the
delay(10)
function takes about 1 second to return instead of 10ms as expected.Here is what I noticed:
The compiler provided by your toolchain is the "riscv64-unknown-elf-gcc (SiFive GCC 8.3.0-2019.08.0) 8.3.0". The Linux and windows versions use the "riscv-nuclei-elf-gcc" in version 9.2. I think you have noticed that nuclei does not offer the compiler in version 9.2 for download. Where the binaries on bintray come from I would be interested to know.
So I installed the "riscv64-unknown-elf-gcc (GCC) 9.2.0" on my Mac. My guess was that the compiler is responsible for the speed difference. Unfortunately a binary compiled on the mac with the 9.2 gcc was not faster either. Also replacing the flags with
-O2
did not have a visible effect.So I started to compare the fast firmware produced by linux and the slow one produced by the 9.2 riscv compiler on my mac. In the disassembly you can see that the binaries are visibly different, but the difference in size is only about 10%, I don't really think that's the reason. Nevertheless I still think that the nuclei compiler does something different.
After some days of research I put everything on the table I know. Do you have any clues why my binaries are so slow?
The text was updated successfully, but these errors were encountered: