From a56b82e72a51407a818ee940d838a1c6e6fdb20b Mon Sep 17 00:00:00 2001 From: Mischievous Meerkat Date: Mon, 2 Nov 2020 00:50:39 +0530 Subject: [PATCH] Updated Developer guides (markdown) --- Developer-guides.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Developer-guides.md b/Developer-guides.md index d9bce96..9d471ac 100644 --- a/Developer-guides.md +++ b/Developer-guides.md @@ -116,6 +116,22 @@ Verify the binary. file nnn nnn: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=1be54d27687f83cf42393dd59dba2723798956de, stripped +## Optimization tips + +Careful use of make variables, static compilation and [upx](https://upx.github.io/) compression can do wonders! + +``` +$ make CFLAGS=-march=corei7 O_NORL=1 O_NOMOUSE=1 O_NOLOC=1 O_NOBATCH=1 O_NOSSN=1 O_NOFIFO=1 O_QSORT=1 O_NOUG=1 static +$ upx nnn-static +$ ls -l nnn-static +-rwxrwxr-x 1 user user 593808 Nov 2 00:45 nnn-static + +# top output (/usr/bin has 1544 files) + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 31953 user 20 0 2428 2244 4 S 0.0 0.0 0:00.02 ./nnn-static -cdDEnQrux /usr/bin +``` + ## Compile for Pi The `nnn` version available as a stable Raspbian package is very out of date (v2.2), which means that the only way to get a recent version of `nnn` is to compile from source.