mhdhejazi / CoronaTracker

Coronavirus tracker app for iOS & macOS with maps & charts
https://coronatracker.samabox.com/
GNU General Public License v3.0
1.54k stars 288 forks source link

performance issue on Mac Catalyst app #122

Open demianturner opened 4 years ago

demianturner commented 4 years ago

The current version of CoronaTracker is beach balling continuously on my mbp 16". Network is not the issue, I have 30 mbps connection. Can't select any country bubbles. Only selection that works is from search results.

My previous version was from around 1 month ago, it worked fine, re-downloading now :-)

UPDATE: Going back through the previous releases one at a time, 1.6 seems to be latest version that doesn't hang UI for macOS release.

mhdhejazi commented 4 years ago

That's weird. It works flawlessly for me. Could you build from source code?

demianturner commented 4 years ago

The problem is identical whether I build the latest release in Xcode, or use the downloadable build. While making the screen cap I noticed the issue only happens at a certain zoom level, as demonstrated here:

https://monosnap.com/file/jAa8z38P3lKe2gzIqWK9e0TZDk7f3I

Zoomed out is fine, but zoom in a little and the app runs at 100% CPU. Also noticed that the bubble for UK is located over Nigeria.

Screenshot of laptop spec used for testing. CleanShot 2020-06-24 at 10 21 23

mhdhejazi commented 4 years ago

Thank you for the video. That's really weird. I tried to reproduce the issue, but with no luck. Could you pause Xcode when the CPU is 100%, expand the thread call stacks, and take a screenshot please? It should look like this: image

I want to see what's exactly going on.

demianturner commented 4 years ago

No probs, here's a grab:

https://cln.sh/CuW5Wr

mhdhejazi commented 4 years ago

I'm sorry! I forgot to tell you this button shouldn't be selected (it comes initially selected in Xcode). Could you make another grab please?

image

demianturner commented 4 years ago

no probs, here's a more complete trace: https://cln.sh/qi9K3p

I suspect it's a Catalyst glitch to be honest, the 100% CPU surge seems to happen as a result of a single click, and lasts up to a minute, doesn't seem to be network related. I ran the same build in the iPad sim and it's smooth as silk.

Nb, there is a data glitch that puts the UK data bubble in Algeria https://cln.sh/YnhC06

mhdhejazi commented 4 years ago

Thank you again. Unfortunately, I couldn't see what's wrong from the partial screenshot. The problem could also be with a different thread. Without more information, it's hard to understand what's happening and fix the problem.

The annotation issue is now fixed on the master branch. Thank you for your feedback!

gklka commented 4 years ago

I'm experiencing the same. Here is my Time profile from Instruments: http://gk.lka.hu/x/keep/Time_profile.trace.zip

mhdhejazi commented 4 years ago

Thank you so much. It's very helpful.

It looks like an issue with Mac Catalyst. Do you remember the last action you made before the main thread hangs?

Also, could you try to comment out those lines (171->202) and see if the problem is solved? https://github.com/mhdhejazi/CoronaTracker/blob/871ddc1016d4d4a3bcef94d8709174a9078763a1/Corona/Controller/Map/RegionAnnotationView.swift#L171-L202

gklka commented 4 years ago

I wanted to scroll the map right after the app was launched. I’ll try to comment out the mentioned lines later today.

gklka commented 4 years ago

Unfortunately it did not help. :(

mhdhejazi commented 4 years ago

Thank you for taking the time to try. I tried many things but wasn't able to reproduce the problem yet.

wagnerand commented 4 years ago

The same thing happens for me. I can select/deselect bubbles just fine, but as soon as I start dragging the map, the app gets stuck.