Comments (2)
We are working on changing the semantics of clearing rendered content to address this. The current behavior is derived from how nodes are used in Paper, which isn't really comparable to how other apps may want to adopt them.
In Paper, two exceptional conditions are true:
- Essentially everything has a "working range", similar to what is implemented for ASTableView.
- The content, in general, is so memory intensive that in order to avoid constantly triggering memory warnings (which /cannot/ be relied upon for stable operation, as they aren't guaranteed to be sent before the app is killed), any content outside of the working range should be purged of rendered backing stores.
The easiest way to achieve this was having nodes clear their contents when removed from the hierarchy, which should work quite well in ASTableView with reasonably-set working ranges. It also works well in apps that have organic transitions between different states, rather than UIViewController pushes and pops. Of course, neither of those things are true for many other apps, so it would make more sense to require an explicit call to clear contents.
Lastly, using a system that pre-decodes images is an anti-pattern with ASDK. Such systems are typically wasteful of memory because they don't adjust according to what content is coming onscreen soon, or what content is now offscreen and no longer needed. We found that driving these decisions at the UI layer, in close reaction to what the user is currently doing, allowed us to make more careful use of memory—while also minimizing the chance that the user reaches un-rendered content.
I believe task 37 describes essentially the same thing as this, but we'll leave this one open until it is resolved.
from asyncdisplaykit.
Play around with the framework after the fix for issue 37 and let me know your thoughts. I believe it now implements the proper tradeoff of controlling memory usage (it should be easily possible to discard the decoded version to save memory, knowing that if the node has to be shown again, a decode cost will be paid again).
There are probably several things that could be done to better explore the right way to use AsyncDisplayKit with image download helpers, but most of them should support downloading images without doing the decoding. If you're using AsyncDisplayKit in the scenarios where it will really help your app, it seems best to me that it controls when images are decoded and you also use its -recursivelyReclaimMemory method to keep memory usage under control.
from asyncdisplaykit.
Related Issues (20)
- Custom flow layout did not work in ASCollectionNode ,But work in UICollectionView
- Build failed with XCode Version 9.3 (9E145) HOT 12
- How to reload SupplementaryElement (UICollectionElementKindSectionHeader)
- [ASTableNode] When tableNode is reloading I see several empty rows, but they have the content
- collectionNode always lost several cells and give me some blank cells HOT 1
- Change maximumNumberOfLines from 5 to 0, The text is stretched. HOT 2
- Full screen button doesn't appear on ASVideoPlayerNode HOT 2
- Dictionary Parsing Problem HOT 1
- Expected method to read dictionary element not found on object of type 'id<NSObject>' HOT 3
- I need a error log while playing ASVideoPlayerNode HOT 1
- page control HOT 1
- updateContentSize HOT 1
- ASTableNode will scroll to the top after insert rows
- enableSubtreeRasterization causes ASButtonNode to not receive touch event HOT 1
- ASButtonNode highlighted titles shifts to the right HOT 2
- CollectionNode fetches all content from NSFetchResultsController
- willDisplayNodeContentWithRenderingContext not work HOT 2
- Sometimes `ASPerformMainThreadDeallocation` does not work HOT 2
- ASTextKitContext.mm(line 62) return nil.
- How to get ASCellNode location on ASCollectionNode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncdisplaykit.