bokluboka · 2022-05-16 14:48
I'm compiling emacs from source I've already enabled json, native compilation. though i found i can optimized c code by giving flags ,
so far i've done
CFLAGS="-O3 -mtune=native -march=native -fomit-frame-pointer -pipe " LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
but i want more, I suspect, i can optimize emacs more , using flags.
I want speeeeeeeeeeeeeeeeeeeeed ,
Only thing left is CFLAGS , LDFLAGS
I also heard of PGO
Anybody expert on this ?
Thank you :\*
frozeninfate · 2022-05-16 15:00
https://wiki.gentoo.org/wiki/GCC_optimization
Hooxen · 2022-05-16 16:19
have you noticed a difference with those LDFLAGS?
_viz_ · 2022-05-16 17:23
IIRC O3 is not recommended
jpellegrini · 2022-05-16 22:09
Yes, as it may make the program faster, but may also slow it down. But it can be an interesting option ***if*** some serious benchmark shows it's worth it.
StrangeAstronomer · 2022-05-16 22:35
Apparently this also speeds things up: http://blog.binchen.org/posts/emacs-speed-up-1000.html
redguardtoo · 2022-05-17 04:02
> I'm compiling emacs from source I've already enabled json, native compilation. though i found i can optimized c code by giving flags ,
Yes. Besides, the project could be also be placed into ramdisk.
redguardtoo · 2022-05-17 04:05
Read some books about lisp and Linux command line tools.
Emacs could be faster. But the way to speed up is not as you think.
arthurno1 · 2022-05-17 08:38
I have one tip: benchmark! And second one: benchmark more.
You should definitely do a comparison between -O2 and -O3, and do one change at a time and benchmark with that change.
serg_foo · 2022-05-18 00:20
Do you want your emacs config to start faster? Or is there any particular operation which in your opinion should take less time?
Although magic flags do work sometimes, things like -O3 will typically make numerical code go faster thanks to loop vectorization for example. But interpreters and GUI applications typically don't benefit too much from these. E.g. byte-code inpreter won't get significantly faster just because of more agressive loop vectorization, same for redisplay engine, GC etc. With native compilation you may want to ensure that extra speedy optimizaation flags get passed to the elisp you're compiling.
If you're just excited to try out some shiny things then you can take a look at https://github.com/facebookincubator/BOLT, which is like PGO AFAIU. But again, in would definitely help if you have some elisp snippet that would measure the performance you care about so that you can see how much things improved after you enable a flag like -O3 or apply a tool like BOLT.
deaddyfreddy · 2022-05-18 00:28
is it slow?