-
Notifications
You must be signed in to change notification settings - Fork 310
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
chore: improve perf of hot path #637
Conversation
Can you describe the fix and the problem with text instead of just a picture next time. It would help with searchability and context in the future if this comes back up |
@wolfy1339 added some context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a chore:
commit will not trigger a new release. Improving performance without changing behavior is a fix:
console.warn = originalLogWarn; | ||
console.error = originalLogError; | ||
|
||
expect(calls).toStrictEqual(["warn", "error"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you changed the nature of this test, can you please revert that? Please add a test where we log with all 4 methods
octokit.log.debug("foo");
octokit.log.info("bar");
octokit.log.warn("baz");
octokit.log.error("daz");
and check that only warn and error was logged
expect(calls).toStrictEqual(["warn", "error"]);
🎉 This PR is included in version 5.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Reduce the hot path in core ;)
An investigation regarding the hotpaths showed that the console.warn and .error binding results take some time. Also a forEach call is Kind of hot.
To improve the performance console.warn and console.error are bound once at startup.
before
Resolves #ISSUE_NUMBER
Before the change?
After the change?
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!