ios - Improving UIWebView initialization time -


my company uses uiwebview display ads. issue i'm having initializing uiwebview appears expensive; profiling time profiler shows [uiwebview alloc] initwithframe:cgrectmake(0,0,500,500)] take 31–40ms. enough cause noticeable frame drops in games running @ 60 fps.

is there way workaround slow initialization time? current ideas create uiwebview when app launches (but before gameplay has started), , reuse (potentially creating pool of them reuse, how uitableviewcell works) or try , see if wkwebview has better performance.

here findings:

  1. wkwebview not initialize faster. creating wkwebviews took similar amount of time creating uiwebviews (in 1 test did, took 46ms create 2 wkwebviews.
  2. the first web view created takes longer create subsequent web views. first 1 takes 31–42 ms; subsequent ones take ~11ms create. news here creating first web view when e.g. app launches allows future webviews created more cheaply, avoiding 40ms hit while game running.
  3. creating pool of uiwebviews solution use case. creating webviews @ app launch , reusing them, avoid causing frame drop while game running.

Popular posts from this blog

javascript - Js, document.getElementById("ID").innerHTML, error -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -

jquery - jqGrid update specific column data with out refreshing the entire column? -