Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: eval "$(gh copilot alias -- bash)" takes 0.5 second to load #88

Open
yermulnik opened this issue Jul 9, 2024 · 5 comments
Open
Labels
bug Something isn't working needs-triage needs to be reviewed

Comments

@yermulnik
Copy link

yermulnik commented Jul 9, 2024

What happened?

What did you do? What happened? What did you expect to happen?

eval "$(gh copilot alias -- bash)" took 0.5 sec to load (I'm the "User is not authorized to use this Copilot feature"). I'd expect it to load much faster as 0.5 sec is a way too slow.

Versions

What versions of the relevant software are you running?
For example: gh v2.37.0, gh-copilot v0.5.2-beta

  • gh version 2.52.0 (2024-06-24)
  • version 1.0.3 (2024-05-08)

Relevant terminal output

Please copy and paste any relevant terminal output.
Please check your output before submission to ensure sensitive information is redacted.

> time eval "$(gh copilot alias -- bash)"

real    0m0,611s
user    0m0,210s
sys     0m0,053s

and another workstation:

> time eval "$(gh copilot alias -- bash)"

real    0m0,548s
user    0m0,156s
sys     0m0,037s

Ubuntu and Mint if it matters.

@yermulnik yermulnik added bug Something isn't working needs-triage needs to be reviewed labels Jul 9, 2024
@jarrodldavis
Copy link

I have the same issue using eval "$(gh copilot alias -- zsh)" on macOS. Strangely, the entire script to be evaluated is emitted instantly, it's just that the gh command takes a long time to exit.

@BagToad
Copy link

BagToad commented Nov 20, 2024

I suspect this actually has more to do with gh startup time than the gh-copilot extension - see cli/cli#9724

@yermulnik @jarrodldavis, could you try setting TCELL_MINIMIZE=1 and let us know if that improves the performance?

@jarrodldavis
Copy link

@BagToad That helped performance a bit, but only reduced from 0.11s to 0.07s (according to time). As I noted initially, the issue is after the script is emitted, suggesting that it's an issue with the exit time, not the startup time. Additionally, I notice this slow exit consistently across all gh copilot commands (even gh copilot --help), but the root gh command is fast.

@yermulnik
Copy link
Author

> export TCELL_MINIMIZE=1
> time eval "$(gh copilot alias -- bash)"

real    0m1,250s
user    0m0,167s
sys     0m0,080s

# second run
> time eval "$(gh copilot alias -- bash)"

real    0m1,116s
user    0m0,120s
sys     0m0,037s

🤔

@BagToad
Copy link

BagToad commented Nov 20, 2024

Ah, thanks for trying that out! Sounds like we have more investigating to do 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

3 participants