-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Replies: 4 comments · 10 replies
-
It could be a bug in Clang, you could try to measure the performance with GCC. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I tried it with NixOS, Arch, and Ubuntu on Clang and GCC. Pretty sure it's my hardware or spdlog. What results do you get when you run the benchmarks, and what hard ware do you have? I'd really appreciate it. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Now I do not have a machine running a UNIX OS running directly on the hardware. |
Beta Was this translation helpful? Give feedback.
All reactions
-
It may be helpful to use |
Beta Was this translation helpful? Give feedback.
All reactions
-
BTW, you are measuring benchmarks with debug builds. cd $(mktemp -d) &&
git clone https://github.com/gabime/spdlog.git &&
cd spdlog &&
mkdir build &&
cd build &&
-cmake .. -D SPDLOG_BUILD_BENCH=ON &&
+cmake .. -DCMAKE_BUILD_TYPE=Release -D SPDLOG_BUILD_BENCH=ON &&
make -j &&
cd bench &&
./bench 1000000 &&
./async_bench 1000000 8 &&
./latency |
Beta Was this translation helpful? Give feedback.
All reactions
-
@yuannan Did building with DEBUG caused the problem? |
Beta Was this translation helpful? Give feedback.
All reactions
-
I've tried it explicitely with the "Release" flag which has the original results. Here is the log for the "Debug" build Debug Build R7 5800H
|
Beta Was this translation helpful? Give feedback.
All reactions
-
The debug bug is significantly slower than the Release build which is to be expected. The results that stick out to me are that even the ones disabled at compile time are now taking some time process. |
Beta Was this translation helpful? Give feedback.
All reactions
-
The results for the debug build on my phone are slower which are to be expected, however, it is still faster than my laptop in certain cases. The gap is much closer, and more in line what result should be. SD8-G2 Debug Build
|
Beta Was this translation helpful? Give feedback.
All reactions
-
Interestingly, GCC 13 doesn't slow down the debug build, and Clang 19 doesn't slow down as much on the Debug build. GCC 13 Debug Build
Clang 19 Debug Build
|
Beta Was this translation helpful? Give feedback.
All reactions
-
Debug builds are irrelevant for performance. Is there a problem with the release performance or not? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, it's a problem with the release build. I only posted with DEBUG as you asked. |
Beta Was this translation helpful? Give feedback.
All reactions
-
There may be a problem with the optimization of the release build, but that would be a compiler issue and difficult to investigate. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I've tested it with GCC and Clang on multiple packaged systems (NixOS, Arch, and Ubuntu). Could do a test on Red Hat systems as well. The effect is consistent on my laptop with a fairly recent Ryzen CPU. I've been trying to get my hands on more hardware to test but my resources are limited. This has the potential to affect a lot of users, not just myself. |
Beta Was this translation helpful? Give feedback.
-
I'm using spdlog in a C++ application and I'm testing it on my laptop (Ryzen 7 5800H) and my phone (Qualcomm SM8550-AB Snapdragon 8 Gen 2).
I'm compiling this NixOS with Clang 18, GCC 13, repeated on Arch, as well as Ubuntu which all return similar results.
The results on Ryzen are shockingly slow compared to the the i7-4770 (the one shown in
/README.md
.The i7-4770 is able to complete basic_st in around 0.17s, while my 5800H takes 1.38! That is >8X slower!
Is this benchmark data old, and spdlog has simply gotten slower over time or is my setup improperly configured?
I decided to test this on my phone with Termux and Clang 19, and the results were even more shocking. It is substaintly quicker than my 5800H by ~4 times for
./bench
!The results for async are very wacky, Ryzen speeds up by quite a bit, while Snapdragon slows down. I would only expect one general pattern. It could either speed up because now more thread are being used and the load is distributed. Or it can slow down as more thread as fighting over the same resources. However, I'm seeing both on 2 different platforms!
The results are even stranger when I do the
./latency
test on both of my devices. My phone once again whoops a laptop grade CPU.Ryzen 7 5800
Snapdragon 8 Gen 2
All of this has left me with more questions than answers, does anyone know why my laptop seems to have such lackluster performance, and is this worth opening a bug report?
I would really appreciate if others can run the bencmarks on their systems and what differences you experience.
This is what I did to get the benchmarks to run:
Beta Was this translation helpful? Give feedback.
All reactions