Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issues on Windows #9

Open
joncol opened this issue Apr 18, 2017 · 21 comments
Open

Performance issues on Windows #9

joncol opened this issue Apr 18, 2017 · 21 comments

Comments

@joncol
Copy link

joncol commented Apr 18, 2017

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
Copy link

idoo commented Apr 18, 2017

@joncol try to debug that issue with profiler

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

@domtronn
Copy link
Owner

@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
Copy link
Author

joncol commented Apr 18, 2017

slati_profile.zip

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

@joncol
Copy link
Author

joncol commented Apr 18, 2017

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

@domtronn
Copy link
Owner

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
Copy link
Contributor

jwintz commented Apr 18, 2017

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
Copy link
Owner

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
Copy link
Owner

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
Copy link
Author

joncol commented May 14, 2017

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

@joncol
Copy link
Author

joncol commented May 15, 2017

@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
Copy link
Owner

domtronn commented May 16, 2017

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
Copy link
Author

joncol commented May 19, 2017

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
Copy link

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

@stephanschubert
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

FYI - I pushed a change to projectile (bbatsov/projectile@7951b17) 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 - #9 (comment) 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
Copy link

seagle0128 commented Jul 24, 2017

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
Copy link

braham-snyder commented Jul 30, 2017

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
Copy link
Contributor

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

@amolgawai
Copy link

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

@jw-miaem
Copy link

flydiff is still an issue on mac for me - #9 (comment)

r-darwish added a commit to drrlvn/config-files that referenced this issue Mar 11, 2018
drrlvn pushed a commit to drrlvn/config-files that referenced this issue Mar 11, 2018
drrlvn pushed a commit to drrlvn/.emacs.d that referenced this issue Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests