Replies: 6 comments 14 replies
-
It could be a bug in Clang, you could try to measure the performance with GCC. |
Beta Was this translation helpful? Give feedback.
-
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.
-
@yuannan Did building with DEBUG caused the problem? |
Beta Was this translation helpful? Give feedback.
-
Debug builds are irrelevant for performance. Is there a problem with the release performance or not? |
Beta Was this translation helpful? Give feedback.
-
@yuannan In virtual machine environment, from the measured results; Multithreading is far inferior to single-threading in performance. What are the possible or direct causes of the performance degradation? [info] ************************************************************** |
Beta Was this translation helpful? Give feedback.
-
@yuannan Does it support bare metal? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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