agnoster-zsh-theme icon indicating copy to clipboard operation
agnoster-zsh-theme copied to clipboard

Performance improvements

Open 0xabu opened this issue 7 years ago • 3 comments

This PR improves performance, especially when we're not in a git repo, by cutting down the number of forks/execs needed just to render the prompt. It's a particularly noticeable speedup on Cygwin.

0xabu avatar Jul 28 '17 17:07 0xabu

While this may improve performance, I don't think this will drastically reduce the number of forks. print is a zsh builtin and shouldn't cause a fork. Additionally, any call to a zsh function shouldn't cause a fork.

There's also a large chance this adds back the exploit (https://github.com/njhartwell/pw3nage) which was fixed in #33.

The jobstates fix does seem like it might help though.

belak avatar Nov 24 '17 18:11 belak

@belak Hmm, I think you're right about the exploit being re-introduced; I hadn't noticed that when I did this work. But what about the other change (897b31f) to use $jobstates rather than $(jobs | wc) -- that's two forks avoided (one for the subshell, one for wc), and you could take it independently of the other commit.

0xabu avatar Nov 24 '17 21:11 0xabu

Unfortunately I don't have merge access to this repo... I'm just fairly familiar with the code.

The first commit looks fine to me though. :)

belak avatar Nov 24 '17 21:11 belak