nicklockwood / FXBlurView

[DEPRECATED]
Other
4.94k stars 713 forks source link

performance issue #53

Closed tzuyangliu closed 10 years ago

tzuyangliu commented 10 years ago

i was adding a blur view as a tabbarview, but on instruments i notice that the transient bytes is consistently rising without stop. as soon as i removed the blurview from my view, the rising stoped. I know that the transient bytes is dealloced, but i'm wondering if there is a way to avoid it, because i guess alloc memory also has an impact on performance. (there is about 10GB memory alloced in a few minutes!) thank you very much

nicklockwood commented 10 years ago

FXBurView is constantly creating images and releasing them. There's not really any way to avoid that, except by disabling dynamic mode.

For best performance, disable dynamic mode and only update the blur effect when the content behind it changes. If the content scrolls, the best way to do that is to update the blur from the scrollViewDidScroll delegate method.

tzuyangliu commented 10 years ago

your suggestion helps a lot (your code really simplify my work,thank you again!)