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

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -