codex icon indicating copy to clipboard operation
codex copied to clipboard

[sketch] Skip login shell on some commands.

Open cassirer-openai opened this issue 4 weeks ago • 1 comments

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       

cassirer-openai avatar Dec 04 '25 08:12 cassirer-openai

https://github.com/openai/codex/pull/7587 I dropped the benchmark. Probably better not to store this in the public repo

jif-oai avatar Dec 04 '25 15:12 jif-oai