Skip to content

Instantly share code, notes, and snippets.

@joker1007
Last active January 11, 2021 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joker1007/712534255802c456ef8ee5772203a3ca to your computer and use it in GitHub Desktop.
Save joker1007/712534255802c456ef8ee5772203a3ca to your computer and use it in GitHub Desktop.
Ruby-3.0.0 benchmark with optcarrot on Ryzen9 5900X

Environment

Linux 5.10.6-gentoo #1 SMP PREEMPT Mon Jan 11 02:51:36 JST 2021 x86_64 AMD Ryzen 9 5900X 12-Core Processor AuthenticAMD GNU/Linux
% cat /proc/cpuinfo
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 25
model		: 33
model name	: AMD Ryzen 9 5900X 12-Core Processor
stepping	: 0
microcode	: 0xa201009
cpu MHz		: 3479.568
cache size	: 512 KB
physical id	: 0
siblings	: 24
core id		: 0
cpu cores	: 12
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 16
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
bugs		: sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 7386.26
TLB size	: 2560 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]
% gcc --version
gcc (Gentoo 9.3.0-r2 p4) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compile options

CFLAGS="-O3 -march=native"
RUBY_CONFIGURE_OPTS=""

gcc 9.3.0 cannot optimize for zen3 architecture.

non-JIT

% ruby -v -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
fps: 55.673503998193645
checksum: 59662

--frames 3000

% ruby -v -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes --frames=3000
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
fps: 54.42881754790477
checksum: 60838

--frames 3000 --opt

% ruby -v -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes --frames=3000 --opt
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
fps: 158.1010892741477
checksum: 60838

JIT

% ruby -v --jit -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
fps: 123.22112001326119
checksum: 59662

--frames 3000

% ruby -v --jit -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes --frames=3000
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
fps: 139.0553948487938
checksum: 60838

--frames 3000 --opt

% ruby -v --jit -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes --frames=3000 --opt
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
fps: 166.65782145704728
checksum: 60838

non-JIT (3.1.0-dev)

% ruby -v -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes
ruby 3.1.0dev (2021-01-11T12:13:45Z master 66a844fd07) [x86_64-linux]
fps: 57.761315432383476
checksum: 59662

--frames 3000

% ruby -v -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes --frames=3000
ruby 3.1.0dev (2021-01-11T12:13:45Z master 66a844fd07) [x86_64-linux]
fps: 57.832407440784195
checksum: 60838

--frames 3000 --opt

% ruby -v -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes --frames=3000 --opt
ruby 3.1.0dev (2021-01-11T12:13:45Z master 66a844fd07) [x86_64-linux]
fps: 157.20485574371878
checksum: 60838

JIT (3.1.0-dev)

% ruby -v --jit -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes
ruby 3.1.0dev (2021-01-11T12:13:45Z master 66a844fd07) +JIT [x86_64-linux]
fps: 124.05388580688584
checksum: 59662

--frames 3000

% ruby -v --jit -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes --frames=3000
ruby 3.1.0dev (2021-01-11T12:13:45Z master 66a844fd07) +JIT [x86_64-linux]
fps: 141.40517210473467
checksum: 60838

--frames 3000 --opt

% ruby -v --jit -Ilib -r./tools/shim bin/optcarrot --benchmark examples/Lan_Master.nes --frames=3000 --opt
ruby 3.1.0dev (2021-01-11T12:13:45Z master 66a844fd07) +JIT [x86_64-linux]
fps: 170.73211772190623
checksum: 60838
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment