From 64dfe36d347a2b329d8c0b6baa3ff782e66f0233 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Tue, 9 Aug 2022 14:16:43 +0100 Subject: Add note about hugepages to the readme. --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 99f3fe6..1d6d5ca 100644 --- a/README.md +++ b/README.md @@ -268,3 +268,52 @@ The table below additionally includes `--late-keyboard-init` in the arguments. + +#### Bonus Round: Transparent HugePages + +It turns out that it's possible to speed up fullscreen windows somewhat with +some advanced memory tweaks. See [this Stack Overflow +question](https://stackoverflow.com/questions/73278608/can-mmaps-performance-be-improved-for-shared-memory) +if you want full details, but basically by setting +`/sys/kernel/mm/transparent_hugepage/shmem_enabled` to `advise`, we can tell +the kernel we're going to be working with large memory areas. This results in +fewer page faults when first allocating memory, speeding up tofi. + +Note that I don't recommend you play with this unless you know what you're +doing (I don't), but I've included it just in case, and to show that the +slowdown on large screens is partially due to factors beyond tofi's control. + +The table below shows the effects of additionally enabling hugepages from the +table above. The dmenu theme has been skipped, as the window it creates is too +small to benefit from them. The Raspberry Pi is also omitted, as it doesn't +support hugepages. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Theme
fullscreen dos
Machine Ryzen 7 3700X
2560px × 1440px
6.9ms ± 1.1ms 3.2ms ± 0.4ms
Ryzen 5 5600U (AC)
2880px × 1800px
7.9ms ± 1.2ms 3.4ms ± 1.0ms
Ryzen 5 5600U (battery)
2880px × 1800px
13.7ms ± 0.9ms 5.6ms ± 0.8ms
-- cgit v1.2.3