4 ms·
I would strongly recommend everyone try the native-comp Emacs 28 branch. Native compilation of Elisp files has greatly improved performance and start-up time, w
by smabie 6y ago
I would strongly recommend everyone try the native-comp Emacs 28 branch. Native compilation of Elisp files has greatly improved performance and start-up time, with no downside.
Though it's bleeding edge, I haven't experienced any issues: everything just works.. faster!
It always amazes me that some people are willing to put in such hard work, alone, for open source. The fact that one guy managed to speed up all of Emacs 2x-20x in his spare time for no pay is frankly amazing. Certainly puts my side-projects to shame.
- josteink 6y ago> It always amazes me that some people are willing to put in such hard work, alone, for open source. For many people this is about scratching an itch, their own itch. They improve upon it not for the sake of "open source", but for the sake of making the very same tools they rely on to be better tools. This is how open-source used to work, and this is how it grew.
- jmnicolas 6y ago> It always amazes me that some people are willing to put in such hard work, alone, for open source. Apart of a few well known projects, the open source world is not so rosy. I'm building an app that exports GPX files (XML file where you can store GPS positions, POIs, routes etc). All the examples files on the official website ( https://www.topografix.com/gpx.asp https://www.topografix.com/gpx.asp ) are broken (they return a blank page) and to validate that your file is compliant you have to compile a 15 years old C++ library first (for some reason they refuse to release a binary).
- iudqnolq 6y agoWhat does your app do? That's an area I'm pretty interested in.
- jmnicolas 6y agoIt's a desktop (Windows) map viewer. I have built my own OSM server to pre-generate tiles so my app has offline capabilities (I have a very slow internet connection so online maps are quite laggy). I use it mostly to build routes that I export as gpx files to my Android phone (vehicle nav with Osmand and trekking with Iphigénie).
- tosh 6y agothis sounds super useful to me (I have been in similar situations in the past @ various formats that aren’t super popular).
- jmnicolas 6y agoWhat sounds useful ? The app ? If you don't have complex requirements there's surely something available for your platform.
- gallexme 6y agoHave a look at https://gdal.org/index.html https://gdal.org/index.html Solved a lot of weird open formats issue we had
- jmnicolas 6y agoThanks but I already wrote the code and after catching a couple gotchas with the validation tool it's fully compliant now. My point was not that GPX is hard (it's not) but that when something is open source most of the time you have to put some elbow grease in it because no one is paid to make it polished. FWIW, it took me less time to write the GPX export code than to look for a binary of the validation tool, fail, then launch WSL and compile the goddam tool.
- yewenjie 6y agoI second every single line of this comment. Here's the update log of the project. https://akrl.sdf.org/gccemacs.html https://akrl.sdf.org/gccemacs.html
- mdaniel 6y agoWith https://akrl.sdf.org/gccemacs.html#orgfc80a25 https://akrl.sdf.org/gccemacs.html#orgfc80a25 being the relevant starting point in that sea of text (the PKGBUILD is also handy for seeing what's going on: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=emacs-native-comp-git#n87 https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=emacs... )
- agumonkey 6y agooss will have to mature a bit like good ol corporate programming did an OSS project will do so much and may die, the next one will try a new branch (from scratch, influenced a bit by the other or fully reusing the old ones) to save energy it's good to think and plan for continuations.. your project will be much more useful if kept clear so other can jump in and extend or rewrite it without struggle
- cmrdporcupine 6y agoIs anybody distributing debian packages of builds off this branch? It's been some years since I built emacs from source...
- auganov 6y agoThe only tricky part for me was having to build gcc (for newer libgccjit). But it wasn't too bad. And you might not have to do that at all depending on your Debian version. Hour effort approx. There was some minor brokenness native comp caused to my setup so still not using this branch. But most stuff did surprisingly work perfectly well.
- cmrdporcupine 6y agoYeah I just ran through the checkout and configure process and found: configure: "error: Installed libgccjit has failed passing the smoke test." FWIW this is libgccjit-10-dev, the most recently available package I could find in my install (debian based Google gLinux). Not sure if I have the motivation to go build it, but who knows! Beats writing design docs, which is the other thing I could be doing ;-)
- auganov 6y agoYea was same for me. It's really not that bad. mkdir gcc cd gcc git clone git://gcc.gnu.org/git/gcc.git src mkdir build mkdir install PREFIX=$(pwd)/install cd build ../src/configure \ --enable-host-shared \ --enable-languages=jit,c++ \ --disable-bootstrap \ --enable-checking=release \ --prefix=$PREFIX \ --disable-multilib nice make -j4 # altering the "4" to however many cores you have [0] May need to install some prerequisites listed here https://gcc.gnu.org/install/prerequisites.html https://gcc.gnu.org/install/prerequisites.html (the error message from the configure might not be obvious so better go through the list first, think I needed MPC and MPFR, whatever I found with apt-cache search libmpc and libmpfr worked). And then configure and make emacs with PATH, LIBRARY_PATH, LD_LIBRARY_PATH including your gcc build (install/bin and install/lib). [0] taken and modified from https://gcc.gnu.org/onlinedocs/gcc-6.4.0/jit/internals/index.html https://gcc.gnu.org/onlinedocs/gcc-6.4.0/jit/internals/index...
- mark_l_watson 6y agoThanks for this! I use Emacs but haven’t invested any time in my setup for a long time. After I get back from my morning hike, I am going to invest some time on this. Thanks again.
- iLemming 6y agoHow do cool kids install Emacs with native-comp support on OSX these days? emacs-plus formula doesn't support it yet and neither does the Mitsuharu's port.
- ashton314 6y agoI'm not sure if I'm cool or not, but I built mine from source. Took a bit of doing. I found a helpful tutorial here: https://gist.github.com/AllenDang/f019593e65572a8e0aefc96058a2d23e https://gist.github.com/AllenDang/f019593e65572a8e0aefc96058...
- iLemming 6y agoOh, you're amazing! This is awesome, thank you. I just built it. Running smoothly.
- iLemming 6y agoI spoke too soon. I missed a step in the instructions. It's not working as expected. I'm gonna have to try again. Combining things from that gist and using some bits from here: https://gist.github.com/mikroskeem/0a5c909c1880408adf732ceba6d3f9ab https://gist.github.com/mikroskeem/0a5c909c1880408adf732ceba...
- ashton314 6y agoMe too, actually. Just found out today that it's not actually doing native comp. >:-( I haven't been able to build GCC with libjit support. (Used Clang while building; that solves some problems with GCC.) I've tried testing GCC/libjit on a smoketest and it hasn't worked. Please let me know what you get working!
- iLemming 6y agoDaamn... I've been building it with clang for the past hour (I dunno why the heck this taking soooo long, I think on Linux it builds much faster). I guess it won't work for me either :( upd: Looks like the proper way of building is with gcc, but it builds without GUI. I need GUI.
- ashton314 6y agoI just build this from source on my macbook. I noticed significantly higher CPU usage while scrolling. (30%! Non-native comp Emacs 28 w/GUI is around 10–20% when scrolling through a file with lsp mode turned on.) Is this expected? The scrolling seems to stutter at times for me. What am I doing wrong?
- smabie 6y agoDid you compile all of the Elisp files using a high optimization level? If so, you might want to get in contact with the author. I imagine that OSX isn't as well tested as Linux.
- ashton314 6y agoI might try setting that. I’m pretty new to all this; could you point me to where I can find instructions on how to set the optimization level?
- smabie 6y agoI think you can just do: (setq comp-speed 3) Then you should tell it to recompile all of your elisp files: (native-compile-async "~/.emacs.d/elpa/" <n> t) (native-compile-async "<path/to/system/elisp/files>" <n> t) Where <n> is the number of threads you want. It's also possible than you have deferred compilation and that's the problem?
- ashton314 6y agoThank you! I’ll give this all a try.
- ashton314 6y agoDarn it. When I try running the `native-compile-async` function, I get thrown into the debugger with a message telling me that Emacs wasn't compiled with native compiler support. I did have to use clang instead of gcc to get past some errors about not finding Appkit.h. I'll have to do more digging and try and get gcc working. Thanks for your help though!