Skip to content

perf: reduce optional chaining usage#382

Merged
gurgunday merged 1 commit intomasterfrom
remove-optional-chaining
Sep 26, 2024
Merged

perf: reduce optional chaining usage#382
gurgunday merged 1 commit intomasterfrom
remove-optional-chaining

Conversation

@gurgunday
Copy link
Copy Markdown
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
Copy Markdown
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
@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