Commit Graph
4958 Commits
Author SHA1 Message Date
appleguy 0a5c1f43a8 [ASRunLoopQueue - Performance] Add ASDeallocQueue for efficient object teardown. (#2399)
* [ASRunLoopQueue - Performance] Add ASDeallocQueue for efficient object teardown.

This measurably reduces block overhead and context switching.  In the layout benchmark,
it increases ops/s while actually reducing CPU utilization.  This suggests that we are
now at a lock-bounded local maximum, at least for tri-core devices.

* [ASDeallocQueue] Update convenience helper method and adopt in ASImageNode etc.

* [ASDeallocQueue] Reimplement the queue using a timer-based runloop.

* [Debugging] Re-enable ASDisplayNode Event Log.

* [ASDeallocQueue] Final refinements, comments, code minimization.

* [ASDeallocQueue] Fix for lock release needed in early return (refactoring typo from last commit)
2016-10-17 12:24:11 -07:00
appleguy 11293d545a [ASLayout - Performance] Avoid weak ivar access & method call to check layoutElementType. (#2397)
* [ASLayout - Performance] Avoid weak ivar access & method call to check layoutElementType.

This shows up in benchmarking profiles for layout-bound workloads.

* Add comment
2016-10-17 12:23:45 -07:00
Adlai Holler 925e343e32 Make ASNetworkImageNode test wait (#2406) 2016-10-17 11:28:48 -07:00
Michael Schneider ae9e128214 Layout inspector instance variable should be weak in ASCollectionView (#2405) 2016-10-17 10:51:54 -07:00
Hannah Troisi 902bb0999d remove miscellaneous true values (#2391)
[Code Cleanup] Replace `true` values with `YES`
2016-10-15 18:28:46 -07:00
Adlai Holler 0ed8ecb677 Test and improve the ASNetworkImageNode progress block handling (#2386) 2016-10-15 17:50:16 -07:00
Hannah Troisi 3c995d8d12 [Examples] Layout 2.0 updates (#2382)
[Examples] Layout 2.0 updates: Switch YES to 1.0 for flexGrow and flexShrink
2016-10-15 17:30:48 -07:00
appleguy 42d1c9a55b [ASCellNode] Add subclass method cache; skip visibility rect calculations in the common case. (#2388)
Profiling showed this area as the most expensive part of ASRangeController propogation of .interfaceState,
when scrolling an ASTableView.  This is very much on the critical path for sustained 60FPS in these views.
2016-10-15 09:58:57 -07:00
Adlai Holler c2ea7cfeac [Umbrella] ASCollectionView -> ASCollectionNode Migration, Separate Index Spaces (#2372)
* Separate dataSource & UIKit index spaces

Beef up our supplementary node support

Make the API way better

Go nuts

Add a unit test for UICollectionView's handling of reloadData inside batch updates

Wrap indexPathForNode: in a cache

Convert index paths in delegate methods

Go back on table view

Put collection view back

Switch up the API

Move most ASCollectionView API to ASCollectionNode

Move most table logic over to ASTableNode

Do the things

More conversion work

Keep on keepin' on

Get table view delegate API done

More porting

Simplify

Clear the delegate

More cleanup

Move more stuff around

Remove pointless file

Re-add some API

Put back more API

Use the right flag

* Some cleanup

* Remove incorrect comment

* Tweak the API

* Put back a couple methods

* update example projects (note: ASCollectionView deprecation warnings expected)

* change reloadDataWithCompletion:nil --> reloadData

* Clean up rebase

* Make deprecated numberOfItemsInSection methods optional

* Use the right flag

* Address nits

* update ASDKTube, ASDKgram & ASViewController examples
2016-10-14 17:21:16 -07:00
Adlai Holler fb768683bc Fix test method name (#2380) 2016-10-14 09:58:32 -07:00
Garrett Moon 1d28639301 [ASCollectionNode] Add scrollableDirections method to ASCollectionViewLayoutInspecting p… (#2381)
* Add scrollableDirections method to ASCollectionViewLayoutInspecting protocol

ASViewController's default method will not always return the correct scrollable
directions in cases where size changes may not have been applied. This allows
us to ignore this issue for a little while longer by allowing the layout
inspector to explicitly vend this.

* Better header, thanks @maicki!
2016-10-14 09:39:28 -07:00
Michael Schneider 3f11c67c82 Return CGSizeZero in case a ASNetworkImageNode is asked for the size and the image did not load yet (#2378) 2016-10-13 14:03:15 -07:00
Adlai Holler cb838664aa [ASTextNode] Go Back to Having Renderer as Ivar (#2376)
* Revert "Disable ASTextKitRenderer cache (#2315)"

This reverts commit 4aa7c9631d.

* Revert "[ASTextNode] Add NSCache based cache for ASTextKitRenderer (#2199)"
2016-10-13 11:37:56 -07:00
Adlai Holler 60b40d8e1c Revert "Scrollable direction is invalid until a relayout. (#2375)" (#2377)
This reverts commit 9abae013a7.
2016-10-13 11:24:57 -07:00
Garrett Moon 9abae013a7 Scrollable direction is invalid until a relayout. (#2375) 2016-10-13 10:51:23 -07:00
appleguy 4595ebc06e [ASLog] Add new ASProfilingSignpost defines for System Trace flags. (#2370)
* [Debugging / Profiling] Add kdebug_signpost calls to Range and DataController.

* [ASLog] Add new ASProfilingSignpost defines for System Trace flags.

* [ASLog] Improve kdebug_signpost logging: ASRunloopQueue and AsyncDisplay, and colors.
See https://github.com/facebook/AsyncDisplayKit/pull/2370 for screenshots.
2016-10-13 10:31:22 -07:00
Garrett Moon 8729bc0502 This is super minor, but active processor account takes into processors that may be out of commission due to boot arguments or thermal conditions. (#2373) 2016-10-12 15:54:59 -07:00
Michael Schneider 8491155fb4 Add locking for ASStackLayoutElement and ASAbsoluteLayoutElement (#2371) 2016-10-12 13:40:53 -07:00
Michael Schneider 8f8df537d2 Rename ASRelativeSize to ASLayoutSize (#2369) 2016-10-11 16:36:40 -07:00
Michael Schneider 507bc55504 [Layout] Add ASLayoutElementStylability protocol (#2366)
* Add ASLayoutElementStylability protocol

* Rename to styledWithBlock:, add instancetype and add noescape
2016-10-11 09:16:18 -07:00
Garrett Moon 4f3593b211 Improving documentation based on feedback. Thanks @appleguy! (#2364)
* Improving documentation based on feedback. Thanks @appleguy!

* :palm + forehead:
2016-10-07 16:59:44 -07:00
Adlai Holler c72b2b212c Tiny change to the doc for ASDimensionMake (#2362) 2016-10-07 10:00:58 -07:00
Hannah Troisi a79e0be016 quick renaming (#2358) 2016-10-07 09:32:38 -07:00
Michael Schneider bb7118a26a Fix ASAbsoluteLayoutSpec creation children protocol (#2357) 2016-10-06 20:37:12 -07:00
Adlai Holler aece8365dd Adjust layoutAttributes logic to account for new iOS 10 behavior (#2354) 2016-10-06 19:42:36 -07:00
Garrett Moon 881863fd1b [Documentation] Improve ASCollectionNode docs. (#2318)
* Improve ASCollectionNode docs.

* Spelling fix, thanks @hannahmbanana

* Address Adlai's comments
2016-10-06 21:20:24 -04:00
Michael Schneider 6f2c7caac3 [Layout] Improve ASDimensionMake via NSString (#2351)
* Improve ASDimensionMake via NSString

- ASXCTAssertEqualDimensions
- Add support for "auto"
- Assert if given an empty or invalid string

* Address comments

* Add ASCGFloatFromString and ASCGFloatFromNumber

* Rename CGRect+ASConvenience to CoreGraphics+ASConvenience
2016-10-06 16:29:33 -07:00
Michael Schneider 166414dfc9 [Layout] Lazy initialize ASLayoutElementStyle in ASDisplayNode and ASLayoutSpec (#2352)
* Lazy initialize `ASLayoutElementStyle` in `ASDisplayNode`

* Lazy initialize `ASLayoutElementStyle` in `ASLayoutSpec`
2016-10-06 16:53:40 -04:00
Michael Schneider 94f958c4a3 [Layout] Treat flex factors as true factors (#2349)
* Treat flex factors as factors

* Add snapshot tests

* Address comments
2016-10-06 16:53:26 -04:00
Adlai Holler 124234fef8 [Umbrella] Add warn_unused_result Attribute to Public Headers (#2353)
* Add some warn_unused_result attributes

* Add more

* Add some more
2016-10-06 16:44:49 -04:00
Michael Schneider 271ab20de5 Fix ASDimension creation of type ASDimensionUnitFraction via a NSString (#2347) 2016-10-05 18:30:24 -07:00
Garrett Moon 27cccc74ae [Documentation] Added docs for ASBasicImageDownloader & ASPINRemoteImageDownloader (#2327)
* Added docs for ASBasicImageDownloader & ASPINRemoteImageDownloader

* Had wrong @return syntax for sharedPINRemoteImageManager
2016-10-05 17:47:45 -07:00
Garrett Moon 874dda00cf [Documentation] Improve ASVisibility protocol documentation (#2319)
* Improve ASNavigationController, ASTabBarController and ASVisibility protocol documentation.

* Spelling and grammar fixes. Thanks @hannahmbanana!
2016-10-05 17:43:59 -07:00
Garrett Moon df049eceef Added docs for initer and node property. (#2326) 2016-10-05 17:35:07 -07:00
Garrett Moon b9e54363ef Documenting ASWeakProxy (#2328) 2016-10-05 17:33:47 -07:00
Garrett Moon f1bf9be4d8 [Documentation] Add docs for exclusionPaths (#2325)
* Add docs for exclusionPaths

* Clearer, less-infringy
2016-10-05 17:32:44 -07:00
Garrett Moon 409c14890d [Documentation] Improve ASCollectionView docs. (#2317)
* Improve ASCollectionView docs.

* Move note to @note.

* Hannah comments
2016-10-05 17:16:53 -07:00
Garrett Moon 23d1b00a46 Implement ivar on _ASDisplayLayer to speed up getting node from layer. (#2346) 2016-10-05 17:09:08 -07:00
Adlai Holler bb366d14f0 [ASCellNode] Restore Layout Attributes Fix + iOS 10 Modification (#2335)
* [ASCellNode] Fix applyLayoutAttributes not called, add readonly layoutAttributes property (#2321)

* Clear cell node layout attributes in didEndDisplayingCell: also
2016-10-05 17:31:46 -04:00
appleguy 3f1f5667c3 [ASDisplayNode] Add -displayWillStartAsynchronously: method to allow skipping synchronous image cache check. (#2344) 2016-10-05 12:48:54 -04:00
Scott Goodson b928e79cb5 [ASDisplayNode] Optimize pendingDisplayNodes check using isEmpty (ASWeakSet). 2016-10-05 00:13:34 -07:00
Adlai Holler 4dfe2a5a66 [ASAsyncTransaction] Make System Less Specific to Layer Display, More Readable (#2332)
* Make ASAsyncTransaction system less specific to layer-display, more readable

* Document weird import
2016-10-04 20:07:22 -04:00
Michael Schneider 2de129008f Remove dependencies for ASAssert and ASThread in the async transaction system (#2333) 2016-10-04 19:49:14 -04:00
Michael Schneider f369be43dd [Examples] Fix extra examples (#2342)
* Fix

* Add building extra examples to build.sh

* Fix example projects

* Fix CarthageBuildTest

* Export NSArray+Diffing.h to fix life without cocoapods
2016-10-04 19:34:14 -04:00
Garrett Moon 04ed52f995 [Documentation] Improve ASTableView docs. (#2316)
* Improve ASTableView docs.

* Matching ASCollectionView style.
2016-10-04 18:17:23 -04:00
Adlai Holler ba2e12010b [ASCollectionView] Only remeasure all nodes if bounds changed in a fixed dimension (#2343) 2016-10-04 18:12:34 -04:00
ricky 872aad220f [ASTextKitFontSizeAdjuster] Use the constrainedSize’s height to adjust font scaling (#2309)
* refactor shrinking logic

# Conflicts:
#	AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.mm

* fix ASTraitCollection sample

* updated comments.

* fix build errors

* adlai’s comments
2016-10-04 13:01:50 -04:00
Michael Schneider d6e5e27c39 [Layout] Add helper properties for setting sizes via CGSize and ASRelativeSize (#2324)
* Remove set layout style size helper

* Update API to set and get a CGSize / ASRelativeSize from an ASLayoutElementStyle

- Expose ASRelativeSize type
- Add new helper properties to set a size / relative size to ASLayoutElementStyle
- Don't expose the size in ASLayoutElementStyle anymore and move into ASLayoutElementStylePrivate

* Update examples

* Update comments for size helpers
2016-10-04 12:35:45 -04:00
Adlai Holler f027a8be80 Remove ASSentinel (#2336) 2016-10-04 12:22:16 -04:00
appleguy 360541fac5 [ASDisplayNode] Change _pendingDisplayNodes from NSMutableSet to ASWeakSet. (#2340)
In at least some cases, _pendingDisplayNodes referencing self can cause the
object to live longer than the application needs, while tearing down views.

It also appears there may be a cancellation condition where this state is
not balanced properly, which can cause a reference-cycle leak.  This change
safely fixes this problem when tested against a repro case for it.

I'm filing a followup task to make sure all cancellation edge cases have
proper accounting for this codepath, even though the leak is fixed.
2016-10-04 10:22:54 -04:00