Skip to content

fix: slow CLI start up time#118

Merged
aeneasr merged 1 commit intomasterfrom
fix-cli-startup-time
Oct 23, 2021
Merged

fix: slow CLI start up time#118
aeneasr merged 1 commit intomasterfrom
fix-cli-startup-time

Conversation

@aeneasr
Copy link
Copy Markdown
Member

@aeneasr aeneasr commented Oct 23, 2021

Found a deeply nested dependency which was importing https://github.com/markbates/pkger, causing unreasonable CPU consumption and significant delay at start up time. With this patch, start up time was reduced from almost 3 seconds to 0.03 seconds for cold starts and 0.00s for hot starts.

$ time cli
cli  2.55s user 2.46s system 508% cpu 0.986 total

$ time ./cli-patch
./cli-patch  0.03s user 0.03s system 40% cpu 0.160 total

$ time ./cli-patch
./cli-patch  0.00s user 0.00s system 64% cpu 0.001 total

Related issue(s)

Checklist

  • I have read the contributing guidelines
    and signed the CLA.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added necessary documentation within the code base (if
    appropriate).

Further comments

Found a deeply nested dependency which was importing `https://github.com/markbates/pkger`, causing unreasonable CPU consumption and significant delay at start up time. With this patch, start up time was reduced from almost 3 seconds to 0.03 seconds for cold starts and 0.00s for hot starts.

```
$ time cli
cli  2.55s user 2.46s system 508% cpu 0.986 total

$ time ./cli-patch
./cli-patch  0.03s user 0.03s system 40% cpu 0.160 total

$ time ./cli-patch
./cli-patch  0.00s user 0.00s system 64% cpu 0.001 total
```
@aeneasr aeneasr merged commit 3b887e9 into master Oct 23, 2021
@aeneasr aeneasr deleted the fix-cli-startup-time branch October 23, 2021 19:55
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.

1 participant