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

Performance issues on Windows #9

Open joncol opened 7 years ago

joncol commented 7 years ago

Hi,

When activating spaceline-all-the-icons on Windows (10) I get really slow performance. Just moving the cursor in the scratch buffer is slow.

No such problems on my Linux machine.

I'm using Emacs 25.1 in both cases.

Any idea what could cause this?

idoo commented 7 years ago

@joncol try to debug that issue with profiler

Probably that answer can help you http://stackoverflow.com/a/25326326

domtronn commented 7 years ago

@joncol I'm afraid I'm not sure, there's a similar issue raised here domtronn/all-the-icons.el#28...

Unfortunately, I don't have my windows machine at the moment so I won't be able to investigate this myself! But I'd be very interested in the profiling results :)

joncol commented 7 years ago

slati_profile.zip

This profile was created by moving the cursor up and down many times in the scratch buffer.

joncol commented 7 years ago

(Can be opened with profiler-find-profile.)

domtronn commented 7 years ago

That's odd... It doesn't look like it's that intensive on the CPU, seeing as helm seems to be using the majority of it. I'm not familiar with profiling so I don't know if this is truly indicative of your performance issue. 😞

My intuition would tell me it's the way Windows Emacs does redisplaying... But I wouldn't know where to begin with it! I'll let you know if I get time to look into this... But I'm going to put it on hold from my perspective, sorry.

jwintz commented 7 years ago

I must admit, on MacOS Sierra, I also notice notable performance issues since I switched to spaceline-all-the-icons, especially when switching form a buffer to another of when creating a (built-in, not helm) completion list.

Will investigate.

domtronn commented 7 years ago

w.r.t. performance, unfortunately yeah there may be a bit of a performance hit with some of these segments... Since its evaluating a fair amount of lisp regularly, sometimes including IO operations! I don't know how often the mode line redraws - I know it definitely redraws when you switch buffer so that might be what you're seeing @jwintz.

The best I can advise is customising it to your liking until your happy with performance. I work on a MacOS El Capitan and whilst it's sometimes noticeable compared to a vanilla mode line, it is doing and displaying a lot more information. I guess its all a trade off :) But I'm more than happy to accept performance improvements for segments!

domtronn commented 7 years ago

Hey @joncol

I've been making a lot of performance improvements to this package (mainly through introducing memoization in all-the-icons). Unfortunately, I still don't have a access to a windows machine, but you could try again after updating the packages, see if that improves things 🙂

joncol commented 7 years ago

@domtronn: Cool, I'll try it out (probably tomorrow) and let you know the results.

joncol commented 7 years ago

@domtronn: I have to say that it's still very sluggish. The time from when I press a key to when something happens is something like 250 - 500 ms.

domtronn commented 7 years ago

Boooooo, that's unfortunate 😞

I don't suppose you could get a profile report for me for memory? That might tell me what Windows is struggling to do

joncol commented 7 years ago

Attaching memory and cpu profile reports. The only thing I did during this profile was to move around the cursor. Hope it helps.

prof.zip

Kungsgeten commented 7 years ago

Try to add this to your init: (setq inhibit-compacting-font-caches t)

stephanschubert commented 7 years ago

Same problem here on OSX 10.12.5 (16F73) and Emacs 25.2 with Spacemacs on latest develop branch.

@Kungsgeten I've tried it here on OSX but I still experience noticeable lags even with cursor movements.

alexmurray commented 7 years ago

I found the same thing - turns out is was a combination of diff-hl and spaceline-all-the-icons - I had diff-hl-flydiff-mode enabled - once turning this off was much faster. Seems spaceline-all-the-icons wants to be called on every redisplay - and so each time you move the cursor it recalculates spaceline-all-the-icons--git-statistics - which would call into diff-hl and would be slow due to diff-hl-flydiff-mode.

For now I have disabled diff-hl-flydiff-mode but it would be great to see if a lot of these details could instead be cached and not have to be recomputed on each redisplay - ie. only update diff info when a change is made and then cache it - same for other bits.

alexmurray commented 7 years ago

FYI - I pushed a change to projectile (https://github.com/bbatsov/projectile/commit/7951b17e6d4adef8fcb4e15ef6c466ef53b59ccf) to cache (projectile-project-root) which helps with some performance issues - I noticed this myself with spaceline-all-the-icons but I see I am not the only one - https://github.com/domtronn/spaceline-all-the-icons.el/issues/9#issuecomment-302646833 shows a lot of hits for (projectile-project-root) as well - so try using the latest git version of projectile and see if this helps you too.

seagle0128 commented 7 years ago

I am experiencing the same issue on both macOS 10.12 and Windows 7, with GNU Emacs 25.2. spaceline-all-icons is very pretty but extremely laggy, no matter whether enabling diff-hl-flydiff-mode or not. CPU and Mem consumption is very high. I attach the profiler reports for reference.

profiler.zip

braham-snyder commented 7 years ago

FWIW, for me, that projectile-project-root-caching commit fixed consistent, significant slowdowns I was seeing on OS X (when, for example, moving point forward and backward by words) in all files within a particular non-project subdir (perhaps just due to how deeply nested the subdir was, didn't look into it further) -- thanks @alexmurray

alexmurray commented 7 years ago

@braham-snyder - you're welcome - glad it was helpful to you.

amolgawai commented 6 years ago

suggestion by @Kungsgeten fixed the performance issue for me. I was having trouble just navigating the buffer on windows 10

jw-miaem commented 6 years ago

flydiff is still an issue on mac for me - https://github.com/domtronn/spaceline-all-the-icons.el/issues/9#issuecomment-315944262