0

I have a very complex, but static, ViewController A that presents ViewController B over it. B completely covers A and is opaque.

I noticed that if I present B using UIModalPresentationOverFullScreen my FPS drops to around 30, but if I use UIModalPresentationFullScreen the FPS is closer to the desired 60. I know since B is being presented opaquely over A that it doesn't make sense to use the former style, but I'm curious to know why the rendering engine is still struggling since as far as it knows, it doesn't need to render/update A.

Warpling
  • 2,024
  • 2
  • 22
  • 38
  • "I'm curious to know why the rendering engine is still struggling" So why don't you use Instruments and find out? – matt Sep 25 '15 at 19:37
  • @matt I used instruments to get this far, but don't know how to investigate it further. I was hoping someone with a deeper understanding of how views are composited might have an idea. Why is this a bad question? – Warpling Sep 25 '15 at 19:43
  • Hard to see what possible satisfactory answer anyone could give from this distance. You don't even say what is _happening_ that is "struggling". Only you know what you're doing that is slow and where the time is being spend during that. Given that you've supplied no information whatever, what possible reply would make you happy that Instruments can't tell you? – matt Sep 25 '15 at 19:53
  • @matt I *don't* know what I'm doing that is slow; I only know that when presenting a VC "over full screen" it causes a performance hit versus when it's just "full screen." This is definitely because two VCs are being managed rather than one. My hypothesis was that if I made the top VC fully opaque would essentially be like removing the lower VC, but this doesn't seem to be the case. I was trying to be as clear and concise as I could in the question but apparently failed. How could I reword the question? – Warpling Sep 25 '15 at 20:07
  • I imagine it is because with full screen, the presenting controllers views are removed. With over full screen, all your presenting view controllers views are still in operation. I imagine iOS assumes you picked the presentation style because you may have pieces which are not opaque in controller B. Given both options exist, iOS has no need to check the opaque status for all views as it has devolved that to you. As @matt says, only way to know what it is going on to slow it down is from the instruments. – Rory McKinnel Sep 25 '15 at 20:07
  • Thank you @RoryMcKinnel. That is my hunch as well. As far as I can tell from instruments there's nothing discernible slowing it down. I believe it's all layer compositing costs, which didn't make sense to me considering the opaque covering view. I'm not sure how to investigate compositing costs beyond coloring views in instruments. – Warpling Sep 25 '15 at 20:14
  • @Warpling Given life is short and your controller B is opaque, do you really need to know 8^). Just use UIModalPresentationFullScreen. – Rory McKinnel Sep 25 '15 at 20:18
  • @RoryMcKinnel In my actual project it's not opaque and I found a workaround by using `UIModalPresentationFullScreen` over a screenshot of the bottom view, I was just curious to learn :) – Warpling Sep 25 '15 at 20:21

0 Answers0