* Remove experimental features
* prevent blocking main thread
* remove small content all together as none is the default
* Update ASExperimentalFeatures.h
~/Texture/Source/Private/ASMutableElementMap.mm:32:24: warning: Conversion from value of type 'NSMutableArray<NSMutableArray *> *' to incompatible type 'ASMutableCollectionElementTwoDimensionalArray *'
_sectionsOfItems = (id)ASTwoDimensionalArrayDeepMutableCopy(items);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* Rename ASDN C++ namespace to "AS." Referring to the framework as ASDisplayNode is pretty out-dated and verbose. See CoreAnimation which usees CA for their internal namespace.
More using
* More cases
* Adds support for using UIGraphicsImageRenderer in ASTextNode.
In many cases this reduces the backing store of text nodes by 1/2.
* Guard for UIGraphicsRenderer availability.
* Comma
Found by Clang Static Analyzer:
~/Texture/Source/ASTextNode2.mm:663:39: warning: Potential leak of an object stored into 'truncationTokenLine'
CTLineRef truncationTokenLine = CTLineCreateWithAttributedString((CFAttributedStringRef)_truncationAttributedText);
^
~/Texture/Source/ASTextNode2.mm:666:49: warning: Potential leak of an object stored into 'additionalTruncationTokenLine'
CTLineRef additionalTruncationTokenLine = CTLineCreateWithAttributedString((CFAttributedStringRef)_additionalTruncationMessage);
^
2 warnings generated.
Before the change: both - (void)setShouldInvertStrongReference:(BOOL)shouldInvertStrongReference and - (void)setNode:(ASDisplayNode *)node will call through [self setupReferencesWithNode:node]; which call the [node addInterfaceStateDelegate:self];
Luckily it seems this didn't cause huge memory bloat because there's
a check below that keeps the display flag from being set in low memory
conditions when the node is off the screen.
Right now when an image node enters preload state, we kick off an image request with the default priority. Then when it enters display state, we change the priority to "imminent" which is mapped to the default priority as well. This means that requests from preload and display nodes have the same priority and are put to the same pool. The right behavior would be that preload requests should have a lower priority from the beginning.
Another problem is that, due to the execution order of -didEnter(Preload|Display|Visible)State calls, a node may kick off a low priority request when it enters preload state even though it knows that it's also visible. By the time -didEnterVisibleState is called, the low priority request may have already been consumed and the download/data task won't pick up the new higher priority, or some work needs to be done to move it to another queue. A better behavior would be to always use the current interface state to determine the priority. This means that visible nodes will kick off high priority requests as soon as -didEnterPreloadState is called.
The last (and smaller) issue is that a node marks its request as preload/low priority as soon as it exits visible state. I'd argue that this is too agressive. It may be reasonble for nodes in the trailing direction. Even so, we already handle this case by (almost always) have smaller trailing buffers. So this diff makes sure that nodes that exited visible state will have imminent/default priority if they remain in the display range.
All of these new behaviors are wrapped in an experiment and will be tested carefully before being rolled out.
* Add imports
* Fix build failure
* Encapsulate common logics into methods
* Address comments
* Make ASTextNode2 more forgiving when searching for links by searching a 44x44 square around the touch
* Trailing whitespace
* Safely handle end-of-line
* 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