- 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
test | non-gc avg (s) | gc avg (s) | gcs avg | tot avg (s) | tot avg err (s) |
---|---|---|---|---|---|
bubble | 0.42 | 0.00 | 0 | 0.42 | 0.03 |
bubble-no-cons | 0.57 | 0.00 | 0 | 0.57 | 0.03 |
bytecomp | 1.03 | 0.00 | 0 | 1.03 | 0.01 |
dhrystone | 0.96 | 0.00 | 0 | 0.96 | 0.00 |
eieio | 0.55 | 0.00 | 0 | 0.55 | 0.01 |
fibn | 0.00 | 0.00 | 0 | 0.00 | 0.00 |
fibn-named-let | 0.43 | 0.00 | 0 | 0.43 | 0.00 |
fibn-rec | 0.00 | 0.00 | 0 | 0.00 | 0.00 |
fibn-tc | 0.00 | 0.00 | 0 | 0.00 | 0.00 |
flet | 0.67 | 0.00 | 0 | 0.67 | 0.00 |
font-lock | 0.44 | 0.00 | 0 | 0.44 | 0.13 |
inclist | 0.77 | 0.00 | 0 | 0.77 | 0.01 |
inclist-type-hints | 0.74 | 0.00 | 0 | 0.74 | 0.01 |
listlen-tc | 0.07 | 0.00 | 0 | 0.07 | 0.00 |
map-closure | 2.75 | 0.00 | 0 | 2.75 | 0.08 |
nbody | 0.57 | 0.00 | 0 | 0.57 | 0.04 |
pack-unpack | 0.14 | 0.00 | 0 | 0.14 | 0.00 |
pack-unpack-old | 0.22 | 0.00 | 0 | 0.22 | 0.00 |
pcase | 1.17 | 0.00 | 0 | 1.17 | 0.02 |
pidigits | 2.10 | 0.00 | 0 | 2.10 | 1.08 |
scroll | 0.00 | 0.00 | 0 | 0.00 | 0.00 |
smie | 0.75 | 0.00 | 0 | 0.75 | 0.00 |
total | 14.36 | 0.00 | 0 | 14.36 | 1.09 |