Pigs fly just fine with with enough thrust.
Pigs fly just fine with with enough thrust.
Example:
# Doing a simple magit refresh results in the following processes being spawned (tracked with dtrace)
# Notice how many calls are completely redundant
2020 May 4 12:46:22 11819 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11820 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11821 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11822 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11823 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11824 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11825 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11826 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11827 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11828 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11829 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11830 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11831 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11832 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11833 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11834 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11835 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11836 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11837 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11838 <67471> 64b /opt/local/bin/git --no-pager -c core.preloadindex=true -c log.showSignature=false <...>
2020 May 4 12:46:22 11839 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11840 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>
2020 May 4 12:46:22 11841 <67471> 64b /opt/local/bin/git --no-pager -c core.preloadindex=true -c log.showSignature=false <...>
2020 May 4 12:46:22 11842 <67471> 64b /opt/local/bin/git --no-pager -c core.preloadindex=true -c log.showSignature=false <...>
2020 May 4 12:46:22 11843 <67471> 64b /opt/local/bin/git --no-pager -c core.preloadindex=true -c log.showSignature=false <...>
2020 May 4 12:46:22 11844 <67471> 64b /opt/local/bin/git --no-pager -c core.preloadindex=true -c log.showSignature=false <...>
2020 May 4 12:46:22 11845 <67471> 64b /opt/local/bin/git --no-pager -c core.preloadindex=true -c log.showSignature=false <...>
2020 May 4 12:46:22 11846 <67471> 64b /opt/local/bin/git --no-pager --literal-pathspecs -c core.preloadindex=true -c <...>Performance issues aside, a pure Lisp magit is the simplest and more universal setup which is why an attempt to fix the process spawning problems there should be made.
So yes, I'd much prefer C code that Daniel Colascione / John Wiegley / Eli Zaretskii / Stefan / Paul .. have reviewed over newly-written FFI code that hasn't been through that thresher. Everyone that jumped on the emacs-libvterm train early knows what I mean.
I keep Emacs running for months at a time and it's the foundation of pretty much everything I do on a computer. Other than the OS, it generally is the most stable, continuously running, continuously stressed piece of software that I have ever used.
Besides, why would a discerning engineer put up with magit creating all these wasteful processes knowing that most of them are redundant, regardless of performance feel? If I was a magit developer, I would surely try to fix this.
Also see https://stackoverflow.com/a/16902730/615245 (I think it's not needed with the latest versions of Git anymore, though).
> If I was a magit developer, I would surely try to fix this.
Since you're just a regular user, did you check out the issue tracker for related discussions?
Emacs 26.1 should perform much better at process creation as it uses vfork on macOS instead of fork.
I don’t think that caching is an easy solution. Git can do a lot of weird things so heuristics are bound to be unreliable, brittle, or both. Furthermore the wins from caching are small for the typical users who use systems that are capable of starting processes in good time.