codex
codex copied to clipboard
[sketch] Skip login shell on some commands.
The overall idea here is that some users might have a .profile which takes a non trivial time to source so it is a bit sad to run -lc when -c is enough.
The code change is just for illustrative purposes. it would have to be cleaned up and implemented better before submission.
My own .zprofile is not very slow so I added an artificial sleep of 300ms to it. Here are benchmark results on some arbitrary prompts:
Per-prompt summary (means ±95% CI):
prompt wall login wall non cmd login cmd non cmd/call login cmd/call non avg cmds login avg cmds non avg mcp login avg mcp non
---------------------------------------------------------------------- ------------ ------------ ----------- ----------- -------------- ------------ -------------- ------------ ------------- -----------
prompt 1: List every immediate subdirectory; for each, run ls (non-... 56.525±0.000 48.601±0.000 3.318±0.000 0.111±0.000 0.415±0.000 0.016±0.000 8.00 7.00 0.00 0.00
Combined summary (means ±95% CI):
scope wall login wall non cmd login cmd non cmd/call login cmd/call non avg cmds login avg cmds non avg mcp login avg mcp non
----------- ------------ ------------ ----------- ----------- -------------- ------------ -------------- ------------ ------------- -----------
all prompts 56.525±0.000 48.601±0.000 3.318±0.000 0.111±0.000 0.415±0.000 0.016±0.000 8.00 7.00 0.00 0.00
https://github.com/openai/codex/pull/7587 I dropped the benchmark. Probably better not to store this in the public repo