react-native/React/Modules
Tadeu Zagallo b03446e27e [ReactNative] Stop traversing the whole view hierarchy every frame
Summary:
@public

`RCTUIManager` would traverse the whole view hierarchy every time there was any
call from JS to Native to call `reactBridgeDidFinishTransaction` on the views
that would respond to it. This is a deprecated method that is only implemented
by 3 classes, so for now we keep track of these views as they're created and
just iterate through them on updates.

Test Plan:
> NOTE: I tested this on UIExplorer, since the internally none of the classes are used

I tried to keep it simple, so I added the following to the old code:
```
__block NSUInteger count = 0;
UIView *rootView = _viewRegistry[rootViewTag];
RCTTraverseViewNodes(rootView, ^(id<RCTViewNodeProtocol> view) {
  count ++;
  if ([view respondsToSelector:@selector(reactBridgeDidFinishTransaction)]) {
    [view reactBridgeDidFinishTransaction];
  }
});
NSLog(@"Views iterated: %zd", count);
```
The output after scrolling 20 sections of the `<ListView> - Paging` example was

```
2015-06-01 00:47:07.351 UIExplorer[67675:1709506] Views iterated: 1549
```

*every frame*

After the change

```
for (id<RCTViewNodeProtocol> node in _bridgeTransactionListeners) {
  [node reactBridgeDidFinishTransaction];
}
NSLog(@"Views iterated: %zd", _bridgeTransactionListeners.count);
```

```
2015-06-01 00:51:23.715 UIExplorer[70355:1716465] Views iterated: 3
```

No matter how many pages are loaded, the output is always 3.
2015-06-01 03:14:14 -08:00
..
RCTAlertManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTAlertManager.m [ReactNative] Add prompt to AlertIOS 2015-05-13 13:24:36 -07:00
RCTAppState.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTAppState.m [RN] fix duplicate observe 2015-05-31 14:46:38 -08:00
RCTAsyncLocalStorage.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTAsyncLocalStorage.m Implemented thread control for exported methods 2015-04-18 11:13:39 -08:00
RCTExceptionsManager.h [ReactNative] differentiate fatal and soft exceptions 2015-05-13 13:24:37 -07:00
RCTExceptionsManager.m [ReactNative] differentiate fatal and soft exceptions 2015-05-13 13:24:37 -07:00
RCTSourceCode.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSourceCode.m [ReactNative] Allow JS know its URL 2015-04-20 14:20:36 -08:00
RCTStatusBarManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTStatusBarManager.m Changed default method queue to a background queue. 2015-04-20 12:02:04 -08:00
RCTTiming.h [ReactNative] Use a single DisplayLink held by the bridge 2015-04-15 07:07:48 -08:00
RCTTiming.m [ReactNative] Create private underlying bridge to prevent retain cycles 2015-05-04 10:36:20 -08:00
RCTUIManager.h Fixed root view background color propagation 2015-05-26 04:18:55 -08:00
RCTUIManager.m [ReactNative] Stop traversing the whole view hierarchy every frame 2015-06-01 03:14:14 -08:00