domtronn / spaceline-all-the-icons.el

A Spaceline Mode Line theme using All The Icons for Emacs
MIT License
235 stars 25 forks source link

Loading spaceline-all-the-icons takes a long time #55

Open drrlvn opened 7 years ago

drrlvn commented 7 years ago

On my machine requiring and calling (spaceline-all-the-icons-theme) takes ~3 seconds, which is a lot longer than e.g. (spaceline-spacemacs-theme).

Would it perhaps be possible to optimize spaceline-all-the-icons so that its impact on init is reduced?

domtronn commented 7 years ago

Hi @spatz, I had a brief look into this a while ago, and I think the biggest performance hit comes from projectile-project-root - Looking at this comment suggests that there have been some performance improvements made to projectile which could be beneficial?

I'll have another look when I get some spare time and see if this is improved.

The other idea I had was to investigate how spaceline handles enabled/disabled segments, and the when predicates... As most of my segments are enabled by default but perform constant checks for the :when predicate.. Perhaps it would perform better if I disable most segments by default and have users enable the ones they want?

I'll post any findings back here 👍

drrlvn commented 7 years ago

Not sure if this is related to projectile as the problem for me is not at runtime, but the call to spaceline-compile for spaceline-all-the-icons, which happens once on load.

While runtime performance improvements are welcome, this issue is specifically for (spaceline-all-the-icons-theme).

domtronn commented 7 years ago

That's not exactly true, it's all based on how spaceline-compile/spaceline-install works, and considering it's building every segment at once any inefficiency of projectile-project-root will show up, especially considering it's used a fair amount in my segments.

Also, the main all-the-icons theme is made up of 51 segments, where as spaceline-emacs-theme and spaceline-spacemacs-theme are made up of 32 and 34 segments respectively..

Benchmarking shows that

So yes, it does seem there's something slowing down the compilation... It's worth remembering that a lot of the segments are richer in content, but I'll do some investigation to see if I can find which segments are slow

idoo commented 6 years ago

I have same performance issues when I use a huge amount of files in file tree (> 200 files in dir)

Linuus commented 6 years ago

Has there been any progress here?

hello-code commented 6 years ago

Still slowly...

untoreh commented 5 years ago
(spaceline-toggle-projectile-root-off)
(spaceline-toggle-all-the-icons-projectile-off)
(spaceline-toggle-all-the-icons-buffer-id-off)