-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(performance): pre-compute and lazily initialize endpoint methods (#…
…622) We have observed that the octokit initialisation is quite slow, especially in combination with [probots](https://github.com/probot/probot) which creates a new octokit instance for each incoming request. This causes the main event loop to block for a considerable time. With our change we moved the preparation of the endpoints api object into the module scope and use a Proxy object to defer the initialisation of octokit defaults and decorations to the first API call per method. Although we have not measured it, we believe the overhead that comes from the proxied method call is insignificant in comparison to the network latency of an API call. Co-authored-by: wolfy1339 <[email protected]>
- Loading branch information
1 parent
7b8950d
commit a7887d0
Showing
2 changed files
with
72 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters