Skip to content

Latest commit

 

History

History
120 lines (106 loc) · 5.92 KB

amd-ryzen-7950x.org

File metadata and controls

120 lines (106 loc) · 5.92 KB

Disable native comp safety guarantees

Specs

  • CPU: AMD Ryzen 7950X with 192GB DDR5 RAM at 4600MHz
  • OS: Gentoo Linux
  • Emacs: 30, commit 7f80070232a5c010ae18de9fd8803a66623c074b
  • Benchmarks: 1.14

Emacs was compiled with the following CFLAGS:

COMMON_FLAGS="-march=native -Ofast -fno-finite-math-only -pipe \
-fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta \
-fno-semantic-interposition"

My overclocking settings on an MSI MEG Godlike X670E motherboard are:

  • Performance Boost Overdrive: 150MHz
  • RAM: 4600MHz
  • Curve Optimizer: -25 on all cores

The GCC version I used to build Emacs was: gcc version 14.0.1 20240421 (experimental) (Gentoo 14.0.1_pre20240421 p26

and Emacs was built with the following three patches applied. I daily drive these patches and they are stable for my Doom Emacs configuration but YMMV.

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index b35e1b97e9d..95d1e494ad6 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -43,7 +43,7 @@
   "Emacs Lisp native compiler."
   :group 'lisp)

-(defcustom native-comp-speed 2
+(defcustom native-comp-speed 3
   "Optimization level for native compilation, a number between -1 and 3.
  -1 functions are kept in bytecode form and no native compilation is performed
     (but *.eln files are still produced, and include the compiled code in
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 2ec55ed98ee..ca8e4574c3b 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -88,7 +88,7 @@ during bootstrap."
   :type '(repeat regexp)
   :version "28.1")

-(defcustom native-comp-compiler-options nil
+(defcustom native-comp-compiler-options '("-march=znver4" "-Ofast" "-g0" "-fno-finite-math-only" "-fgraphite-identity" "-floop-nest-optimize" "-fdevirtualize-at-ltrans" "-fipa-pta" "-fno-semantic-interposition" "-flto=auto" "-fuse-linker-plugin")
   "Command line options passed verbatim to GCC compiler.
 Note that not all options are meaningful and some options might even
 break your Emacs.  Use at your own risk.
@@ -98,9 +98,7 @@ and above."
   :type '(repeat string)
   :version "28.1")

-(defcustom native-comp-driver-options
-  (cond ((eq system-type 'darwin) '("-Wl,-w"))
-        ((eq system-type 'cygwin) '("-Wl,-dynamicbase")))
+(defcustom native-comp-driver-options '("-march=znver4" "-Ofast" "-g0" "-fno-finite-math-only" "-fgraphite-identity" "-floop-nest-optimize" "-fdevirtualize-at-ltrans" "-fipa-pta" "-fno-semantic-interposition" "-flto=auto" "-fuse-linker-plugin")
   "Options passed verbatim to the native compiler's back-end driver.
 Note that not all options are meaningful; typically only the options
 affecting the assembler and linker are likely to be useful.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 12b45f9f5b8..6b9192e21bb 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -137,7 +137,7 @@
   "Emacs Lisp byte-compiler."
   :group 'lisp)

-(defcustom compilation-safety 1
+(defcustom compilation-safety 0
   "Safety level for generated compiled code.
 Possible values are:
   0 - emitted code can misbehave, even crash Emacs, if declarations of

Results

testnon-gc avg (s)gc avg (s)gcs avgtot avg (s)tot avg err (s)
bubble0.420.0000.420.03
bubble-no-cons0.570.0000.570.03
bytecomp1.030.0001.030.01
dhrystone0.960.0000.960.00
eieio0.550.0000.550.01
fibn0.000.0000.000.00
fibn-named-let0.430.0000.430.00
fibn-rec0.000.0000.000.00
fibn-tc0.000.0000.000.00
flet0.670.0000.670.00
font-lock0.440.0000.440.13
inclist0.770.0000.770.01
inclist-type-hints0.740.0000.740.01
listlen-tc0.070.0000.070.00
map-closure2.750.0002.750.08
nbody0.570.0000.570.04
pack-unpack0.140.0000.140.00
pack-unpack-old0.220.0000.220.00
pcase1.170.0001.170.02
pidigits2.100.0002.101.08
scroll0.000.0000.000.00
smie0.750.0000.750.00
total14.360.00014.361.09