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

perf: make all commands faster, especially ape init, adds --name flag to init cmd #2355

Merged
merged 4 commits into from
Oct 31, 2024

Conversation

antazoey
Copy link
Member

What I did

this may be problematic, not sure.
but the reason commands are so slow, like ape init is because of the pre-execution config validation.
i believe that was added as part of showing config errors and such, otherwise you may run into weird problems and not really know why. but oh well, better to have a faster command. Hopefully we can come up with a better config validation system, if we have to.

also adds --name flag to init so you can automate

Before:

ape init --name poop  3.46s

Now:

ape init --name poop  0.29s

How I did it

delete helpful validation

How to verify it

things whip

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@antazoey antazoey changed the title perf: make all commands faster by deleting early config validation perf: make all commands faster, especially ape init Oct 30, 2024
@antazoey
Copy link
Member Author

TESTS PASS YOLO

Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I understand what that existing code was doing. Can you summarize?

@antazoey
Copy link
Member Author

I don't think I understand what that existing code was doing. Can you summarize?

The config determines some default values for click options. Now, those defaults are all callable / lazy so there shouldnt be a need to validate your config until a non-help command is being executed. This code did it early so you could see the config-line numbers / problems.

@antazoey antazoey changed the title perf: make all commands faster, especially ape init perf: make all commands faster, especially ape init, adds --name flag to init cmd Oct 31, 2024
@antazoey antazoey merged commit a6ddfff into ApeWorX:main Oct 31, 2024
16 checks passed
@antazoey antazoey deleted the perf/init branch October 31, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants