Skip to content

Conversation

@TrevorBurnham
Copy link
Contributor

Description

This PR applies two micro-optimizations to getExternalProps:

  • Replace Object.keys().filter() + reduce() with a simple for-in loop
  • Replace indexOf() with startsWith()

My benchmarks show a ~2.5x performance improvement. This function is called on every component render for several components, so small optimizations here add up.

How has this been tested?

Existing tests provide extensive coverage for this functionality.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Replace Object.keys().filter() + reduce() with a simple for-in loop,
and indexOf() with startsWith() for ~2.5x performance improvement.

This function is called on component render to filter internal props,
so the optimization benefits multiple components.
@TrevorBurnham TrevorBurnham requested a review from a team as a code owner January 25, 2026 13:28
@TrevorBurnham TrevorBurnham requested review from ernst-dev and removed request for a team January 25, 2026 13:28
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.

1 participant