1

I have a problem with an app that slows down when calls are made to UIAlert. Alerts take a couple of seconds to appear and a few seconds more to react. At the same time, there is a burst of calls to Firebase/Analytics involving timers, I've copied below. Has anyone ideas or tips on what might be up? I'm running the latest Firebase and Swift versions.

2017-09-03 20:23:41.628 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: MyApp.ViewController, 9XXXXXXXXXXXXXXXX0
2017-09-03 20:23:45.678 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: UIAlertController, 9XXXXXXXXXXXXXXXX1
2017-09-03 20:23:45.678 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS033003] Scheduling user engagement timer
2017-09-03 20:23:45.679 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS002003] Engagement timer canceled
2017-09-03 20:23:45.679 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS002002] Engagement timer scheduled to fire in approx. (s): 3600
2017-09-03 20:23:45.728 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: auto, user_engagement (_e), {
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX0;
        engagement_time_msec (_et) = 41483;
        firebase_screen_class (_sc) = MyApp.ViewController;
        firebase_event_origin (_o) = auto;
    }
2017-09-03 20:23:45.729 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023073] Debug mode is enabled. Marking event as debug and real-time. Event name, parameters: user_engagement (_e), {
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX0;
        engagement_time_msec (_et) = 41483;
        firebase_screen_class (_sc) = MyApp.ViewController;
        firebase_event_origin (_o) = auto;
        firebase_realtime (_r) = 1;
        firebase_debug (_dbg) = 1;
    }
2017-09-03 20:23:45.782 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023072] Event logged. Event name, event params: user_engagement (_e), {
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX0;
        engagement_time_msec (_et) = 41483;
        firebase_screen_class (_sc) = MyApp.ViewController;
        firebase_event_origin (_o) = auto;
        firebase_realtime (_r) = 1;
        firebase_debug (_dbg) = 1;
    }
2017-09-03 20:23:45.784 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 0.8859719038009644
2017-09-03 20:23:45.784 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 0.8859719038009644
2017-09-03 20:23:45.784 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: auto, screen_view (_vs), {
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX1;
        firebase_previous_class (_pc) = MyApp.ViewController;
        firebase_screen_class (_sc) = UIAlertController;
        firebase_event_origin (_o) = auto;
        firebase_previous_id (_pi) = 9XXXXXXXXXXXXXXXX0;
    }
2017-09-03 20:23:45.785 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023073] Debug mode is enabled. Marking event as debug and real-time. Event name, parameters: screen_view (_vs), {
        firebase_event_origin (_o) = auto;
        firebase_realtime (_r) = 1;
        firebase_screen_class (_sc) = UIAlertController;
        firebase_debug (_dbg) = 1;
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX1;
        firebase_previous_class (_pc) = MyApp.ViewController;
        firebase_previous_id (_pi) = 9XXXXXXXXXXXXXXXX0;
    }
2017-09-03 20:23:45.802 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023072] Event logged. Event name, event params: screen_view (_vs), {
        firebase_event_origin (_o) = auto;
        firebase_realtime (_r) = 1;
        firebase_screen_class (_sc) = UIAlertController;
        firebase_debug (_dbg) = 1;
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX1;
        firebase_previous_class (_pc) = MyApp.ViewController;
        firebase_previous_id (_pi) = 9XXXXXXXXXXXXXXXX0;
    }
2017-09-03 20:23:45.802 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023027] Do not schedule an upload task. Task already exists. Will be executed in seconds: 0.8794739246368408
2017-09-03 20:23:46.778 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS002001] Measurement timer fired
2017-09-03 20:23:46.778 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS002003] Measurement timer canceled
2017-09-03 20:23:46.779 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023033] Starting data upload
2017-09-03 20:23:46.781 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023105] Event is not subject to real-time event count daily limit. Marking an event as real-time. Event name, parameters: user_engagement (_e), {
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX0;
        engagement_time_msec (_et) = 41483;
        firebase_screen_class (_sc) = MyApp.ViewController;
        firebase_realtime (_r) = 1;
        firebase_debug (_dbg) = 1;
        firebase_event_origin (_o) = auto;
    }
2017-09-03 20:23:46.829 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023105] Event is not subject to real-time event count daily limit. Marking an event as real-time. Event name, parameters: screen_view (_vs), {
        firebase_event_origin (_o) = auto;
        firebase_realtime (_r) = 1;
        firebase_screen_class (_sc) = UIAlertController;
        firebase_debug (_dbg) = 1;
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX1;
        firebase_previous_class (_pc) = MyApp.ViewController;
        firebase_previous_id (_pi) = 9XXXXXXXXXXXXXXXX0;
    }
2017-09-03 20:23:46.878 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS012018] Saving bundle. size (bytes): 429
2017-09-03 20:23:46.880 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023116] Bundle added to the upload queue. BundleID, timestamp (ms): 1008, 1504463025670
2017-09-03 20:23:46.979 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023038] Uploading events. Elapsed time since last successful upload (s): 40.90037298202515
2017-09-03 20:23:46.982 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023039] Measurement data sent to network. Timestamp (ms), data: 1504463026979, <FIRAPBMeasurementBatch: 0x608000015a50>
2017-09-03 20:23:46.984 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS900000] Uploading data. Host: https://app-measurement.com/a
2017-09-03 20:23:47.091 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS901006] Received SSL challenge for host. Host: https://app-measurement.com/a
2017-09-03 20:23:47.149 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023044] Successful upload. Got network response. Code, size: 204, -1
2017-09-03 20:23:47.153 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): -0.4830329418182373
2017-09-03 20:23:47.154 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): -0.4830329418182373
2017-09-03 20:23:47.279 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023024] No data to upload. Upload task will not be scheduled
2017-09-03 20:23:47.279 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS002003] Measurement timer canceled
cancel action: <UIAlertAction: 0x608000304b60 Title = "Yes" Descriptive = "(null)" Image = 0x0>
2017-09-03 20:23:50.528 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: MyApp.ViewController, 9XXXXXXXXXXXXXXXX0
init nua: (1293.40002441406, 343.466674804688)
2017-09-03 20:23:50.530 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS033003] Scheduling user engagement timer
2017-09-03 20:23:50.531 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS002003] Engagement timer canceled
2017-09-03 20:23:50.532 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS002002] Engagement timer scheduled to fire in approx. (s): 3600
2017-09-03 20:23:50.533 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: auto, user_engagement (_e), {
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX1;
        engagement_time_msec (_et) = 4847;
        firebase_screen_class (_sc) = UIAlertController;
        firebase_event_origin (_o) = auto;
    }
2017-09-03 20:23:50.533 MyApp[32419] <Debug> [Firebase/Analytics][I-ACS023073] Debug mode is enabled. Marking event as debug and real-time. Event name, parameters: user_engagement (_e), {
        firebase_screen_id (_si) = 9XXXXXXXXXXXXXXXX1;
        engagement_time_msec (_et) = 4847;
        firebase_screen_class (_sc) = UIAlertController;
        firebase_event_origin (_o) = auto;
        firebase_realtime (_r) = 1;
        firebase_debug (_dbg) = 1;
    }
nyg
  • 2,380
  • 3
  • 25
  • 40
Shane O'Seasnain
  • 3,534
  • 5
  • 24
  • 31
  • Can you provide what version of the Firebase Analytics SDK, iOS version and the device model? Thanks – adbitx Sep 06 '17 at 21:49
  • I have the latest FA SDK (4.0.3) and iOS is the most recent version too (10.3.3). The problem came up on the simulator with an iPhone 7 plus. Since, posting I've moved the code to a 5s device. The good news is I don't see the delay but I do the same burst of FA calls in my debug window. – Shane O'Seasnain Sep 07 '17 at 05:54
  • The timers are not a concern since they just wake up some later processing in a different queue. My concern is that something may be blocking the main queue that the UIAlert is slow to display. Thanks for providing the details. – adbitx Sep 07 '17 at 22:17
  • By the way, what is the iOS version of the 5s device? Is that 10.3.3 too? – adbitx Sep 07 '17 at 22:28
  • Thanks for explaining the timers. The iOS version on the 5s is 10.3.3. – Shane O'Seasnain Sep 08 '17 at 02:40
  • Would you mind using the Time Profiler on the affected simulator and drill down to where the UIAlertController is slow to respond? It should show what classes and methods that cause the delay. Thanks – adbitx Sep 08 '17 at 16:16
  • Of course, but the Time Profiler will not run on a simuator. I've run a trace on the 5s but there is no visible time delay to follow. – Shane O'Seasnain Sep 09 '17 at 11:11
  • Oh yeah, I forgot that. Thanks for reporting anyway. I'll see if I can reproduce the problem on the iPhone 7s. – adbitx Sep 10 '17 at 07:09

0 Answers0