reddit / emacs

How many lines is you init.el

[deleted] · 2022-09-04 16:43
[deleted]
nv-elisp · 2022-09-04 17:37
> loads pretty quickly due to optimizations I copied from others Are you sure? Have you profiled each of those changes in isolation to be sure they're actually decreasing the load time? If the goal is to actually collect data, you're gonna have to be more specific than "pretty quickly". How long? What OS/system specs? Emacs version? That'd be more useful to see than just a rough estimation. I don't think there's much insight to be gained from this info, though. There are general ways to speed up the loading of an init file: - PROFILE YOUR INIT FILE FIRST. See where the most time is spent. - Defer pakcage loading as much as possible (trivial via use-package). - If you are using Org babel to tangle your config, don't use org-babel-load-file, tangle the elisp file ahead of time and load it directly. > and feels surprisingly manageable. I found breaking it out into separate files helps a lot. "manageable", again, is a non-metric. Hopefully, the responses you get will be more thorough, otherwise this thread will just be a lot of "I like the way I do things! It works for me!"
MitchellMarquez42 · 2022-09-04 19:29
Here's my breakdown: ``` 122 init.el 44 early-init.el 815 lisp/mitch-packages.el 50 lisp/mitch-keybinds.el 126 lisp/mitch-defuns.el 189 lisp/mitch-theme.el 1346 total ``` I have a few other files floating around inactive so I didn't count them. My startup time is between 1.3 and 0.8 seconds, which is not great but probably better than many people's. As you can see, the vast majority of code is in [mitch-packages.el](https://git.mitchmarq42.xyz/mitch/emacs.d/src/branch/main/lisp/mitch-packages.el), and that is all use-package declarations. It's a large file, but I just search for the name of what I want to change and it's there. Honestly I should probably just move everything there, but I like having an init.el with some substance. That keybinds file should go in the use-package for general, but I split it off when I didn't have that many packages and haven't gotten around to consolidating them. Probably the slowest things for me are bootstrapping to a new device, and anything related to PDFs. So I stay away from them. But it's still a shame.
super-linux-nerd · 2022-09-04 20:14
I have 620 lines and my load time is between 0.25 and 0.4 seconds on my various machines.
karthink · 2022-09-04 20:48
~/.emacs.d$ cloc --quiet --vcs=git github.com/AlDanial/cloc v 1.94 T=0.27 s (274.6 files/s, 95147.8 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Lisp 73 2606 5262 17428 ------------------------------------------------------------------------------- SUM: 73 2606 5262 17428 ------------------------------------------------------------------------------- Load time is 0.2-0.3 seconds.
dpassen1 · 2022-09-04 21:07
$ tokei --hidden -t 'Emacs lisp' =============================================================================== Language Files Lines Code Comments Blanks =============================================================================== Emacs Lisp 2 288 222 8 58 =============================================================================== Total 2 288 222 8 58 =============================================================================== Load time is 0.7-0.9 seconds
SequentialDesign · 2022-09-04 21:18
I'm using an .emacs file for start-up. I'm going to change to an init.el at some point. 1367 as of this moment. it loads normally, 5 seconds or so on Windows 10. I've got tons(!) of good stuff in it and tons of fluff(!). going to add a whole bunch more stuff too. for a while, i was getting a closure error, but it went away. dunno how or why. the other day i messed up and used a command I rarely use, upcase or something. well, Emacs bugged out and caps'd every thing, and I thought I undid what it had done, but nope. screwed me big time. destroyed my whole file. thank the gods I had a backup, but even then that was missing some things I had recently added.
deaddyfreddy · 2022-09-04 21:27
a single org file (1900LoC) tangling to a 1600 LoC init.el, including everything ​ Used to have a NIH init system with a bunch of files some time ago, but switched to use-package and realized that a single file works good enough for me
mee8Ti6Eit · 2022-09-04 23:20
Breaking it into separate files will slow startup. You may as well combine it into a single file and add section headers.