* Optimize ASCATransactionQueue. This queue is very busy, and it runs on the main thread so it's important for it to be fast.
Avoid waking up the run loop for every single node.
Avoid a ton of NSPointerArray overhead that we don't need.
Avoid retain/release traffic on the singleton by using an inline function. I confirmed that in release mode, the static __strong is correctly inlined and no ARC traffic is incurred.
* Comment
* Unlock right
* Remove magic number
* Revert node call, useless, the node has a ASDisplayView, and this view forward on the node in first.
* Use convertPoint to convert the given point in hittest & pointInside methods.
Keep the standard usage if the node didn't rasterized a view.
* Removed isNodeLoaded, finally it's useless in this case
In these methods, we are on the mainThread, we can create the view if the view is not created.
* Optimize _assertSubnodeState
This method is actually pretty painful in today's world. In one iPad mini trace, the first page of nodes spent 6.6ms in this call, just in time profiler.
* Clean it up, check count
* Check the right value
* Optimize ASTwoDimensionalArrayUtils
These methods are called on the main thread during range controller updates (i.e. every frame) and so they should be as fast as possible.
* Rename
* Use vector instead of stack array to handle really big cases (e.g. photos)
* Lock up to yogaRoot during layout to avoid dead lock.
1) lock to root for tree
2) lock self to change parent (& consequently root)
3) Implement ASLocking (tryLock) on ASNodeController
4) add lockPair to try-lock node & controller together
5) lock controllers if they exist in lockToRoot...
Disable some asserts due to lock to root. :(
LL# No commands remaining.
* Add macro so non-Yoga still builds :)
* wut
* Add an experimental flag to use native dispatch_apply instead of our core count * 2 approach. This has shown performance wins in some profiling.
* Add in other places
* Improve separation of code for layout method types
* Address PR comments
- Delegate to layout spec engine if the node is a layout spec node but yoga engine was asked for calculate the layout
- Change ASLayoutType to ASLayoutEngineType
- Improve layout engine fall through code
* Add experiment to skip waiting until all updates of collection/table view are committed in -accessibilityElements
The wait was introduced in #1217 which blocks the main thread until updates are proccessed. We suspect this causes perf regressions accross the app and need to confirm this via an experiment.
* Add option to skip default behavior of ASCellLayoutMode
* Fix unit test
* Fix unit test in another way
* Remove import
* Minor change
* Add ASCellLayoutModeSyncForSmallContent
* Update unit tests
* Remove unnecessary change
* Remove unnecessary changes
Initializing the LUT arrays at file level scope creates a large chunk of code retaining and releasing all of the NSStrings in the tables. Moving them to function level moves the initialization to being lazy.
As of today, ASRangeController doesn't manage the interfaceState for supplementary nodes. This bug was introduced with a refactoring of this code a couple months ago.
With this change, the supplementary nodes will automatically enter each interfaceState bit when they are added to a view hierarchy.
* Set automaticallyAdjustsContentOffset when view is load
* [ASTableNode] Update test: set automaticallyAdjustsContentOffset before view is load (#1278)
* Wrap supplementary node blocks to enable resizing them.
Most ASCellNodeBlocks are wrapped by ASCollectionView.mm to add an `interactionDelegate` as well as calling `enterHierarchyState` on the node and setting its transform to a reflection if `inverted` is set on the collectionView.
This PR adds this behavior to supplementary nodes as well.
* Simplify code / block will never be nil
If PIN_ANIMATED is enabled, the creation of a PINRemoteImageManager
will create a sharedDownloader also. Thus we cannot assert that it
doesn't exist. We will move this assertion up to the methods that
create the preconfiguredSharedManager and before said manager is
allocated.
* Introduce ASCellLayoutMode
* Some smaller improvements
* Improve logic around _superPerformBatchUpdates:completion:
* Add comment about default values for ASCellLayoutModeNone
* Always call _superReloadData:completion: within UICollectionView
* Add initial range test for ASCellLayoutModeNone