Commit bcb482f
getDirectManipulationAllowlist should return by const reference to avoid per-frame copies (#55295)
Summary:
Pull Request resolved: #55295
Fix a memory allocation hotspot with getDirectManipulationAllowlist(). Function was returning a static std::unordered_set<std::string> by value instead of by const reference, causing the set to be copied each call.
The fix changes the return type from std::unordered_set<std::string> to const std::unordered_set<std::string>&, eliminating the per-frame copy overhead entirely.
Changelog: [Internal]
Reviewed By: javache, rozele
Differential Revision: D91475194
fbshipit-source-id: 0c438d0f1c1d202e5d665edf26a144c9ffdeaeb01 parent f046599 commit bcb482f
1 file changed
Lines changed: 2 additions & 2 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/animated/internal
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments