Replace TinyMap with std::unordered_map in Differentiator#55680
Open
sammy-SC wants to merge 1 commit intofacebook:mainfrom
Open
Replace TinyMap with std::unordered_map in Differentiator#55680sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC wants to merge 1 commit intofacebook:mainfrom
Conversation
sammy-SC
added a commit
to sammy-SC/react-native
that referenced
this pull request
Feb 23, 2026
…5680) Summary: Replace TinyMap<Tag, X> with std::unordered_map<Tag, X>. There is no detectable regression in performance and code is simpler, let's remove TinyMap. ``` ┌────────────────────────────┬──────────────────┬───────────────────────────────────┬───────────────┐ │ Benchmark │ TinyMap (before) │ unordered_map + ctor size (after) │ Change │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 100 uncollapsable views │ 1,499,917 ns │ 1,343,333 ns │ -10.4% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 1000 uncollapsable views │ 52,148,021 ns │ 44,131,792 ns │ -15.4% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 100 views large props │ 5,131,292 ns │ 4,529,937 ns │ -11.7% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 1000 views large props │ 82,706,813 ns │ 84,334,167 ns │ +2.0% (noise) │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 1500 views large props │ 61,470,542 ns │ 62,976,646 ns │ +2.5% (noise) │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ deep (depth=5, breadth=4) │ 32,672,583 ns │ 30,700,542 ns │ -6.0% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ deep (depth=7, breadth=3) │ 78,523,542 ns │ 74,121,729 ns │ -5.6% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ deep (depth=10, breadth=2) │ 48,328,562 ns │ 45,702,188 ns │ -5.4% │ └────────────────────────────┴──────────────────┴───────────────────────────────────┴───────────────┘ ``` Reviewed By: NickGerleman Differential Revision: D90346356
c453586 to
331a21f
Compare
sammy-SC
added a commit
to sammy-SC/react-native
that referenced
this pull request
Feb 23, 2026
…5680) Summary: Replace TinyMap<Tag, X> with std::unordered_map<Tag, X>. There is no detectable regression in performance and code is simpler, let's remove TinyMap. ``` ┌────────────────────────────┬──────────────────┬───────────────────────────────────┬───────────────┐ │ Benchmark │ TinyMap (before) │ unordered_map + ctor size (after) │ Change │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 100 uncollapsable views │ 1,499,917 ns │ 1,343,333 ns │ -10.4% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 1000 uncollapsable views │ 52,148,021 ns │ 44,131,792 ns │ -15.4% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 100 views large props │ 5,131,292 ns │ 4,529,937 ns │ -11.7% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 1000 views large props │ 82,706,813 ns │ 84,334,167 ns │ +2.0% (noise) │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 1500 views large props │ 61,470,542 ns │ 62,976,646 ns │ +2.5% (noise) │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ deep (depth=5, breadth=4) │ 32,672,583 ns │ 30,700,542 ns │ -6.0% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ deep (depth=7, breadth=3) │ 78,523,542 ns │ 74,121,729 ns │ -5.6% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ deep (depth=10, breadth=2) │ 48,328,562 ns │ 45,702,188 ns │ -5.4% │ └────────────────────────────┴──────────────────┴───────────────────────────────────┴───────────────┘ ``` Reviewed By: NickGerleman Differential Revision: D90346356
331a21f to
4db1842
Compare
…5680) Summary: changelog: [internal] Replace TinyMap<Tag, X> with std::unordered_map<Tag, X>. There is no detectable regression in performance and code is simpler, let's remove TinyMap. ``` ┌────────────────────────────┬──────────────────┬───────────────────────────────────┬───────────────┐ │ Benchmark │ TinyMap (before) │ unordered_map + ctor size (after) │ Change │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 100 uncollapsable views │ 1,499,917 ns │ 1,343,333 ns │ -10.4% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 1000 uncollapsable views │ 52,148,021 ns │ 44,131,792 ns │ -15.4% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 100 views large props │ 5,131,292 ns │ 4,529,937 ns │ -11.7% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 1000 views large props │ 82,706,813 ns │ 84,334,167 ns │ +2.0% (noise) │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ 1500 views large props │ 61,470,542 ns │ 62,976,646 ns │ +2.5% (noise) │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ deep (depth=5, breadth=4) │ 32,672,583 ns │ 30,700,542 ns │ -6.0% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ deep (depth=7, breadth=3) │ 78,523,542 ns │ 74,121,729 ns │ -5.6% │ ├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤ │ deep (depth=10, breadth=2) │ 48,328,562 ns │ 45,702,188 ns │ -5.4% │ └────────────────────────────┴──────────────────┴───────────────────────────────────┴───────────────┘ ``` Reviewed By: NickGerleman Differential Revision: D90346356
4db1842 to
64fbfb8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Replace TinyMap<Tag, X> with std::unordered_map<Tag, X>. There is no detectable regression in performance and code is simpler, let's remove TinyMap.
Summary
Differential Revision: D90346356