2 ms·
> This doesn't just leave a bad taste in my mouth - it is also a giant waste of resources and causes initialization to be substantially slower compared to the a
by sidkshatriya 5y ago
> This doesn't just leave a bad taste in my mouth - it is also a giant waste of resources and causes initialization to be substantially slower compared to the alternative
I agree that shelling out on a whim that Kakoune does is a tremendous waste of CPU cycles as the OS needs to construct and tear down a whole process just to do something trivial. Having said that, in day to day usage, kakoune feels quite responsive. It's also easy to hack up plugins really quickly.
Shelling out is a crude way of getting some parallelism also. You might be surprised that constructing a new thread vs constructing a new process in Linux is not that much different resource/latency wise. Since bash/dash code is probably cached in the system memory somewhere already and libc etc are again dynamically shared, it may not be as bad to construct a whole new process. TL;DR it's bad but maybe not as bad as one thinks. It's definitely avoidable and I would not design it this way myself. I remember having to shell out once because kakscript does not know how to increment 1 to a variable and I needed dash to do that! That was one expensive +1 calculation! and I can almost imagine my CPU heating up!