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: reduce optional chaining usage #382

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Conversation

gurgunday
Copy link
Member

From the V8 blog:

Still, be considerate about using more than one optional chaining operator in a single chain. If a value is guaranteed to not be nullish, then using ?. to access properties on it is discouraged.

It adds more bytecode to each property access

@gurgunday gurgunday requested a review from a team September 26, 2024 19:39
Copy link
Member

@dancastillo dancastillo left a comment

Choose a reason for hiding this comment

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

LGTM - nice optimization!

@gurgunday gurgunday merged commit ff21f5b into master Sep 26, 2024
22 checks passed
@gurgunday gurgunday deleted the remove-optional-chaining branch September 26, 2024 23:20
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