Analytics can impact app performance

Physics with 20 enemies on screen and 60 bullets - no problem, logging the hit’s to my own variables for score and ammo tracking - no problem, logging them to Flurry - Big problems.

I found out today that excessive use of the Flurry Analytics can slow down your app a lot. I had analytics.logEvent(“Hit”) for every enemy hit and analytics.logEvent(“Shoot”) for every bullet fired.

On the simulator it worked fine, on my iPhone4 the game dropped from 60 fps to 9fps, I comment those two lines out and it’s back to 60.

I also had a separate flurry issue today, I was in a cell phone area today with good reception but overloaded towers, the up shot of that is that the phone things data should work but every network request times out, even imessage and web pages. Furry sends data on app launch, it looks like this must be in the main thread because my app launch time changed from 5 seconds to 9 seconds. I set the phone to airplane mode and it went back to the normal launch time.

Does Launchpad send data at app launch? is it in the main thread?
Can we get Flurry to run in a separate thread to not block launch? [import]uid: 110373 topic_id: 19884 reply_id: 319884[/import]

You could always use a proxy like Charles to debug what is going on the network. I do lots of experiments nowadays and i am pretty sure that at application start there are one call for flurry and 2 calls for ansca stats service.

You _may_ misusing flurry… This service is not intented for excessive, high frequency logging. If you want to log “number of shoots” for example; you could send them after player is dead or level is completed. (in one call)

Check out Charles: (it has 30 days fully functional trial)
http://www.charlesproxy.com/

dont forget to change http proxy settings in your device.

deniz.

[import]uid: 11686 topic_id: 19884 reply_id: 77240[/import]

Do you really need to update every time a bullet is fired for instance?

why not keep a total stat of all bullets fired then send that data at the end of a level for instance [import]uid: 84637 topic_id: 19884 reply_id: 77401[/import]

Danny,
That’s the rub, the issue isn’t that the analytics are being sent as they are used. They are already sent at the app close or app pause.

The issue is that the call to the logEvent is storing data on the local device and that command is much slower than storing a value to a var. It’s so slow in fact that if you do it a lot you can kill the performance of your app.

I don’t need to store every bullet, it was data I wanted to use later for marketing. Like “1,000,000,000 bullets fired” and the such. It’s not a blocker issue for me. If you try and log things as fast as possible the whole app slows down to a crawl. This could probably just fall into a later optimization pass of the engine, it’s not a major issue. I wanted to let people know so they don’t trip on the same thing I did.

The only way to send it in a supported fasion to Flurry would be at the end of a level just loop on logEvent for x times. The problem is that would pause the whole app for a bit. We can’t pass paramters with our version of flurry. They do support that but we don’t have it yet. like logEvent(“bullets”,shotsFired)

-Brad
[import]uid: 110373 topic_id: 19884 reply_id: 77403[/import]

Don’t believe any statistics you don’t make up yourself :wink: [import]uid: 12704 topic_id: 19884 reply_id: 77407[/import]