spaceline-all-the-icons.el icon indicating copy to clipboard operation
spaceline-all-the-icons.el copied to clipboard

Performance issues on Windows

Open joncol opened this issue 7 years ago • 21 comments

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?

joncol avatar Apr 18 '17 08:04 joncol

@joncol try to debug that issue with profiler

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

idoo avatar Apr 18 '17 08:04 idoo

@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 :)

domtronn avatar Apr 18 '17 08:04 domtronn

slati_profile.zip

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

joncol avatar Apr 18 '17 08:04 joncol

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

joncol avatar Apr 18 '17 08:04 joncol

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.

domtronn avatar Apr 18 '17 12:04 domtronn

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.

jwintz avatar Apr 18 '17 15:04 jwintz

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 avatar Apr 18 '17 16:04 domtronn

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 🙂

domtronn avatar May 14 '17 08:05 domtronn

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

joncol avatar May 14 '17 13:05 joncol

@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.

joncol avatar May 15 '17 07:05 joncol

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

domtronn avatar May 16 '17 08:05 domtronn

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

joncol avatar May 19 '17 08:05 joncol

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

Kungsgeten avatar Jun 30 '17 07:06 Kungsgeten

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.

stephanschubert avatar Jul 05 '17 10:07 stephanschubert

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 avatar Jul 18 '17 02:07 alexmurray

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.

alexmurray avatar Jul 24 '17 13:07 alexmurray

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

seagle0128 avatar Jul 24 '17 16:07 seagle0128

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

braham-snyder avatar Jul 30 '17 04:07 braham-snyder

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

alexmurray avatar Jul 31 '17 01:07 alexmurray

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

amolgawai avatar Dec 22 '17 10:12 amolgawai

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

jw-miaem avatar Jan 18 '18 18:01 jw-miaem