3 ms·
If all of this matters so much, don’t use an (interactive) shell.
by jbverschoor 5y ago
If all of this matters so much, don’t use an (interactive) shell.
- mort96 5y agoWe're not talking about the shell, we're talking about the options parser. Nothing in my examples invokes any shell.
- deleted 5y ago[deleted]
- jbverschoor 5y agoSure, but who calls your main()? Usually when you're in a shell, which in turn calls exec and copies over some data. If you're that worried about performance about a few string allocations, you shouldn't be passing around strings anyway, shell or not.. And simply call functions from the same process and use for example the file descriptors you already have. You could also just simply pass a binary blob (messagepack) as one of the arguments, if that's your thing.