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

DietPi-Config | CPU performance benchmark #1253

Closed
Fourdee opened this issue Nov 22, 2017 · 6 comments
Closed

DietPi-Config | CPU performance benchmark #1253

Fourdee opened this issue Nov 22, 2017 · 6 comments

Comments

@Fourdee
Copy link
Collaborator

Fourdee commented Nov 22, 2017

Add ability to benchmark CPU performance, using sysbench and a MAX prime value.

This will give users a rough idea of CPU performance, when we compare the total time against other systems.

@Fourdee Fourdee added this to the v159 milestone Nov 22, 2017
@Fourdee Fourdee self-assigned this Nov 22, 2017
@Fourdee
Copy link
Collaborator Author

Fourdee commented Nov 22, 2017

Sysbench testing (removed in favor of bash + int benchmark): https://github.com/Fourdee/DietPi/issues/1253#issuecomment-346881878

Odroid C2 (clearly "cheating" this test?):

image

Z83-ii | Intel Atom Cherry Trail x5-Z8300

image

RPi 3:

image

BBB:

image

Fourdee referenced this issue Nov 22, 2017
+ DietPi-Config | Tools > Benchmarks: Added ability to benchmark CPU
performance using sysbench:
https://github.com/Fourdee/DietPi/issues/1253#issuecomment-346441545
@Fourdee
Copy link
Collaborator Author

Fourdee commented Nov 22, 2017

Completed.

@ThomasKaiser
Copy link

Odroid C2 (clearly "cheating" this test?):

No, just you simply using exactly the wrong tool: sysbench can be used as a compiler benchmark but not to compare CPU performance of different systems/architectures.

An arm64 Stretch binary running on RPi 3 will finish in less than 3.1 seconds (while upstream arm64 binaries for Jessie take ~30% longer). With sysbench everything that matters are compiler switches and that's why you get different numbers depending on the GCC version the binary has been built with (that's the distro dependency) and especially allowing for certain features (that's why arm64 binaries on ARMv8 SoCs outperform armhf binaries by magnitudes). BTW: if you choose sysbench 0.5 instead of the 0.4.12 Debian still uses numbers get also worse.

TL;DR: There's no other tool compared with sysbench that is less capable to show CPU performance comparing different platforms

@Fourdee
Copy link
Collaborator Author

Fourdee commented Nov 24, 2017

@ThomasKaiser

No, just you simply using exactly the wrong tool: sysbench

Whats the correct tool? 😄

With sysbench everything that matters are compiler switches and that's why you get different numbers depending on the GCC version the binary has been built with (that's the distro dependency) and especially allowing for certain features (that's why arm64 binaries on ARMv8 SoCs outperform armhf binaries by magnitudes).

Thanks for the info 👍

So in theory, the only way to ensure a consistent benchmark across platforms:

  • We can compile our own sysbench binaries, ensuring compile options and GCC versions match (where possible) for each CPU arch.
  • Find an alternative (but still the GCC version and compile options will be a factor across CPU arch's)
  • Code my own bash benchmark, integer based only as floating point would require bc, again, causing compile options and GCC versions to be a factor. This all assuming bash compile options again are not a factor.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Nov 24, 2017

Multi-threaded bash integer benchmark:

DietPi users can simply run dietpi-config > Tools > Benchmark > CPU bench to run.

Split over total cores, to reach max value of 1000000. Lower time = faster.

  • RPi Zero = 5 Minutes, 40 seconds ⏳
  • RPi 3 = 24.2 seconds
  • RPi 3 B+ = 20.6 seconds
  • Rock64 = 19.5 seconds
  • NanoPi K1+ (H5) = 18.76 seconds
  • Odroid C2 = 16.8 seconds
  • Z83-II = 15.5 seconds
  • NanoPi Fire 3 = 10.2 seconds
  • XU4 = 11.6 seconds
  • Asus TB = 11.1 seconds
  • NanoPC-T4 / RockPro64 = 9.2 seconds
  • Odroid N1 = 8.5 seconds
  • FX6300 (VM) = 3.6 seconds
  • Ryzen 5 2600 = 1.63 seconds 👏

Non-DietPi users: Copy/paste all

cat << _EOF_ > /tmp/dietpi-bench
#!/bin/bash
target_max_int=1000000
cores=\$(nproc --all)
int_split=\$((\$target_max_int / \$cores ))
aStart_Int=()
aEnd_Int=()

#Split the max int target based on total cores
for (( i=0; i<\$cores; i++ ))
do

    aEnd_Int[\$i]=\$(( (\$i + 1) * \$int_split ))
    aStart_Int[\$i]=\$(( \${aEnd_Int[\$i]} - \$int_split ))

    echo \${aStart_Int[\$i]} \${aEnd_Int[\$i]}

done


Run_Bench()
{

    while (( \${aStart_Int[\$1]} < \${aEnd_Int[\$1]} ))
    do

        ((aStart_Int[\$1]++))

    done

}

#Launch benchmark threads
for (( i=0; i<\$cores; i++ ))
do

    Run_Bench \$i &

done

#Wait for jobs to finish
for job in \`jobs -p\`
do
    echo \$job
    wait \$job
done

#delete[]
unset aStart_Int
unset aEnd_Int

_EOF_
chmod +x /tmp/dietpi-bench

#Run
time /tmp/dietpi-bench

@ThomasKaiser
Copy link

Whats the correct tool?

There is none since it's all about use case. :)

I normally rely on 7z b for a rough estimate of integer performance (and also memory bandwidth which influences results slightly) but on boards with low memory conditions 7z might get killed by the kernel since allocating too much memory and then some use cases aren't really affected by above 'integer performance'.

Or the other way around: on certain SoCs we deal with accelerators for this and that so taking this not into account would be misleading. If someone searches for full disk encryption or a board to be used as VPN endpoint then all those 64-bit SoCs that have ARMv8 AES crpyto extensions licensed are magnitudes faster than those who don't (the latter group consists of all 32-bit SoCs, Raspberry Pi 3 and ODROID-C2).

Fourdee referenced this issue Nov 24, 2017
DietPi-Backup | "Full Backup" Mode is now the default for fresh DietPi
installations. This is mainly due to MySQL data now being in the DietPi
userdata directory.
DietPi-Config | Tools > Benchmarks: Added ability to benchmark CPU
performance based on bash + integer:
https://github.com/Fourdee/DietPi/issues/1253#issuecomment-346881878
@Fourdee Fourdee mentioned this issue Dec 10, 2017
Fourdee referenced this issue Dec 10, 2017
**v159**
(10/11/17)

**Image Modifications:**

VMWare | Updated to Debian Stretch: https://github.com/Fourdee/DietPi/issues/1219

VirtualBox | Updated to Debian Stretch, many thanks @MichaIng: https://github.com/Fourdee/DietPi/issues/1219

RPi | Updated to Debian Stretch: https://github.com/Fourdee/DietPi/issues/475

**Changes / Improvements / Optimizations:**

General | Odroid XU3/4 images updated: Includes kernel support for EMMC 5.1 (thanks Meveric): https://github.com/Fourdee/DietPi/issues/1252

General | DietPi RPi kernel: Updated to 4.9.62.

General | DietPi RPi kernel: Will no longer re-install, if the current version is already at latest.

General | Added farenheit readouts for cpu_info and dietpi-config. For those "over the pond" :D : http://dietpi.com/phpbb/viewtopic.php?f=12&t=2516&p=9772#p9772

General | Sparky SBC: Kernel update to add support for USB 1.1 DACs, thanks @sudeep. This must be enabled manually, if using a USB 1.1 DAC, as this breaks Allo WiFi dongle. Edit "/DietPi/uEnv.txt" and change the value "aotg.aotg1_speed=1" (from "0"), then reboot.
General | We now define a default LD_LIBRARY_PATH for all systems, exported from /etc/bash.bashrc: https://github.com/Fourdee/DietPi/issues/475#issuecomment-350380744

DietPi-Services | Run "dietpi-services help" to see a full list of updated commands: Added support for "enable" and "disable". "disable" will stop and disable the service and prevent it from running, "enable" will enable and start the service. EG: "dietpi-services disable cron", will prevent Cron from starting. Added support for start/stop/restart a single service (eg: dietpi-services stop apache2). This is basically a symlink to systemD: https://github.com/Fourdee/DietPi/issues/1114

DietPi-Config | WiFi: Now uses the wpa_supplicant.conf method to setup WiFi connections. WEP is no longer supported by DietPi in this mode. WPA-PSK/WPA2-PSK and OPEN hosts supported: https://github.com/Fourdee/DietPi/issues/1262

DietPi-Backup | "Full Backup" Mode is now the default for fresh DietPi installations. This is mainly due to MySQL data now being in the DietPi userdata directory.

DietPi-Config | Tools > Benchmarks: Added ability to benchmark CPU performance based on bash + integer: https://github.com/Fourdee/DietPi/issues/1253#issuecomment-346881878

DietPi-Config | Time sync modes: NTP is now uninstalled when SystemD timedatectl is enabled. Reinstalled on demand. Timedatectl pool servers are now also set: https://github.com/Fourdee/DietPi/issues/1208#issuecomment-343762480

DietPi-Software | First run setup, now logged to /etc/dietpi/logs/dietpi-firstrun-setup.log.

DietPi-Software | APT log: Moved to /etc/dietpi/logs/dietpi-software_apt.log, to prevent RAMlog clearing log during automated installations.

DietPi-Software | MPD (Stretch): Install updated to 0.20.11. Also supports native DSD playback (thanks to @sudeep and PJotr), when "Native" output freq/bit is set: https://github.com/Fourdee/DietPi/issues/1236

DietPi-Software | moOde: MPD now installed via pre-built binaries. Will reduce install time: https://github.com/Fourdee/DietPi/issues/1223#issuecomment-345265290

DietPi-Software | Nextcloud: Correct database access issue for MariaDB + minor fixes: https://github.com/Fourdee/DietPi/pull/1242

DietPi-Software | ownCloud: Installation fixed, respecting different distro repos: https://github.com/Fourdee/DietPi/pull/1243

DietPi-Software | MPD (inc YMPD/O!MPD): Default data directory is now "/mnt", this will include all USB drives and network locations: https://github.com/Fourdee/DietPi/issues/1202

DietPi-Software | Mopidy: Default data directory is now "/mnt", this will include all USB drives and network locations.

DietPi-Software | Syncthing: Installation updated to version 0.14.40, for new installations only. Removal of inotify (now included in main syncthing): https://github.com/Fourdee/DietPi/issues/1260

DietPi-Software | Node-Red: Symlink created during install from ~/.node-red to DietPi user data dir: https://github.com/Fourdee/DietPi/issues/1256

DietPi-Software | YMPD: Fixed Stretch installation + Now available for all CPU archs + Upgraded to SystemD service: https://github.com/Fourdee/DietPi/issues/475

DietPi-Software | Gitea: Install updated to 1.3.1 (for new installations only). Added support for ARMv8. Now installed to /mnt/dietpi_userdata/gitea, runs as dietpi user: https://github.com/Fourdee/DietPi/issues/686 http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9863#p9863

**Bug Fixes:**

DietPi-Automation | Resolved an issue where SSH server choice, was not installing selected choice: https://github.com/Fourdee/DietPi/issues/1122

DietPi-Config | Nvidia driver: nouveau now disabled by default on x86_64, fix for 750Ti and possibily other Nvidia chipsets (thanks dubyazero): https://github.com/Fourdee/DietPi/issues/1244

DietPi-Config | RPi Stretch: Resolved an issue with onboard Wifi failing to scan: https://github.com/Fourdee/DietPi/issues/1262

DietPi-Config | RAM Benchmark: Resolved an issue where devices without /tmp mounted to tmpfs would fail the test. We now check for this mount, prior to allowing the test to run: https://github.com/Fourdee/DietPi/issues/1130#issuecomment-350114298

DietPi-Software | Pi-Hole: Resolved various issues with this installation. DietPi will now also detect a failed Pi-Hole script exit and flag as not installed. : https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524

DietPi-Software | Redis: Minor un/installation/activation fixes of PHP module (Thanks to @MichaIng) : https://github.com/Fourdee/DietPi/pull/1249

DietPi-Software | moOde: Resolved an issue where dietpi-drive_manager mounted drives, would not be available in the libary: https://github.com/Fourdee/DietPi/issues/1223#issuecomment-346708298

DietPi-Software | PHP: Solve 'upload_tmp_dir' issue, if PHP service uses 'PrivateTmp': https://github.com/Fourdee/DietPi/issues/1144

DietPi-Software | Syncthing: Resolved a permissions issue with self program updates: https://github.com/Fourdee/DietPi/issues/1260

DietPi-Software | Home Assistant: Resolved an issue with ARMv8 installation, where Python build would fail due to lack of build-essential: https://github.com/Fourdee/DietPi/issues/1255

DietPi-Software | MPD: Corrected various uninstallation issues.

DietPi-Software | APT Removal: Resolved an issue in Stretch, where held packages were not being removed: https://github.com/Fourdee/DietPi/issues/475

DietPi-Software | FFMPEG: Resolved inability to install on XU4 Jessie: https://github.com/Fourdee/DietPi/issues/1273

DietPi-Software | Chromium (RPi Stretch): Resolved installation + desktop icon symlink: https://github.com/Fourdee/DietPi/issues/475#issuecomment-350111359

DietPi-Software | Resolved an issue where dietpi permissions were not being set correctly, for symlinked userdata dir.

DietPi-Update | Resolved an issue where .update_available file would still exist in no network situations: https://github.com/Fourdee/DietPi/issues/1258

Patch_File | Auto swapfile generation no longer run twice (mostly for pre v150 images): https://github.com/Fourdee/DietPi/issues/1257

**Allo Web Interface v4:**

MPD: Native DSD playback support, when "Native" output freq/bit is set in MPD settings page: https://github.com/Fourdee/DietPi/issues/1241

MPD: Default data directory is now "/mnt", this will include all USB drives and network locations.

SQUEEZELITE: Added ability to set native DSD output modes. Please note, success of selected output mode is limited to DAC and kernel capabilities. We have verified Combo 384 with u32le output mode on Sparky SBC + USB Bridge: https://github.com/Fourdee/DietPi/issues/1237#issuecomment-348241209

O!MPD: Updated to 1.03. Please make sure to update your library (Settings > Update), to rescan the new "/mnt" location which includes all networked and USB drives. Depending on your additional storage setup, the rescan may take 5-30 minutes.

RPi Image: Has been updated to Debian Stretch. This offers peformance improvements in the web interface, and newer ALSA libs. Previous installations are still supported. To upgrade, please write the new image. Upgrading to Stretch is not a requirement: http://dietpi.com/phpbb/viewtopic.php?f=8&t=2317&p=8869#p8869

Sparky SBC: We have remove the WiFi Hotspot installation by default, this is to avoid majority users having to remove this software title, before WiFi can be configured via terminal access. To reinstall this software, please connect the WiFi dongle, then run "dietpi-software install 60" via terminal.
@Fourdee Fourdee mentioned this issue Feb 16, 2018
@dnj0104 dnj0104 mentioned this issue Sep 1, 2019
@richard-downes richard-downes mentioned this issue May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants