fix: implement some performance improvements#667
Conversation
* Pre-compute the keys of the `Endpoint` type in order to not have to compute them multiple times * Use interface extends instead of intersections See https://github.com/microsoft/TypeScript/wiki/Performance Part of #666
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
|
I'll try out this branch in my projects and see if it fixes in the issue in #666 🙂 |
|
It should definitely improve things, that's for sure. When I tested some small test code for Octokit, the TypeScript profiler did identify the hotspot with the |
|
I tried testing with the branch locally (outside docker) but it seems the issue persists with the same tracing profile as before. I think this PR is still an overall improvement though. |
…entials/revoke` endpoints, endpoint type updates, type performance fixes (#675) * WIP octokit/openapi updated * fix: implement some performance improvements (#667) * Pre-compute the keys of the `Endpoint` type in order to not have to compute them multiple times * Use interface extends instead of intersections See https://github.com/microsoft/TypeScript/wiki/Performance Part of #666 --------- Co-authored-by: Octokit Bot <33075676+octokitbot@users.noreply.github.com> Co-authored-by: wolfy1339 <4595477+wolfy1339@users.noreply.github.com>
Endpointtype in order to not have to compute them multiple timesSee https://github.com/microsoft/TypeScript/wiki/Performance
Part of #666
Before the change?
keyof Endpointdirectly in the code many times across different filesAfter the change?
Endpointtype that can be shared across many filesextendsfor better performancePull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!