In this video Colt McAnlis, and for temporally allocated bitmaps, there’s a handy trick that you absolutely should be using to escape these performance problems: Re-using bitmaps.
Every time you allocate a bitmap, you have to incur some overhead to allocate the objects from the heap, which is less than ideal if you’ve got a lot of bitmaps. Rather than banging on the heap for new objects each time, you can instead, reuse the memory that an existing bitmap has created, and load your image there.
The end result? Less memory churn from bitmaps.
No comments:
Post a Comment