Commit Graph
14 Commits
Author SHA1 Message Date
Huy Nguyen d102ec81ee Experiment with different strategies for image downloader priority (#1349)
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
2019-03-08 08:11:03 -08:00
Adlai Holler 9958aac5de Pin OCMock version to 3.4.1 because 3.4.2 has issues (#1038) 2018-07-17 19:51:05 -07:00
Scott Goodson a47a1b8c2a Bump podspec to 1.9.3. Remove Cocoapods-generated workspace files. 2015-12-06 20:32:21 -08:00
Scott Goodson 47be24037d Reduce _ASAsyncTransaction allocations by ensuring nodes without display methods don't create them. 2015-09-24 19:26:00 -07:00
Ethan Nagel 451beda238 Update Podfile.lock to match earlier changes to Podfile. 2015-07-21 09:38:40 -07:00
Scott Goodson d8fcfce840 Update .podspec to refer to 1.2.1 release tag. 2015-06-14 20:08:54 -07:00
Scott Goodson e3f0e66cb3 Updating API names for network range and memory culling before ASDK 1.2 tag. 2015-05-21 22:43:38 -10:00
Patrik Tomas Chamelo 19e57d9d46 Update FBSnapshotTestCase to 1.8.1 2015-05-07 14:14:50 -07:00
Ryan Nystrom 527a6228a9 Xcode 6.3 support 2015-04-08 16:35:10 -07:00
Nadine Salter b869d025ff [tests] ASSnapshotTestCase. 2015-03-23 14:06:38 -07:00
Nadine Salter 9f38488fd2 Bump Podfile.lock to CocoaPods 0.35.0. 2015-01-24 11:50:04 -08:00
Nadine Salter 367b6da116 Use ASDisplayNodeScreenScale().
ASImageNode and ASHighlightOverlayLayer were both using
[[UIScreen mainScreen] scale] directly.  Bad.  No cookie.  Use
ASDisplayNodeScreenScale() instead.

(Also, regenerate Xcode project with Xcode 6 and current CocoaPods.)
2014-10-22 13:36:40 -07:00
Nadine Salter 6cfb347355 Shared schemes. 2014-10-15 10:52:13 -07:00
Nadine Salter 15565873c9 Initial commit. 2014-06-26 22:32:55 -07:00