Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance issue on Mac Catalyst app #122

Open
demianturner opened this issue Jun 22, 2020 · 13 comments
Open

performance issue on Mac Catalyst app #122

demianturner opened this issue Jun 22, 2020 · 13 comments

Comments

@demianturner
Copy link

demianturner commented Jun 22, 2020

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
Copy link
Owner

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

@demianturner
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

No probs, here's a grab:

https://cln.sh/CuW5Wr

@mhdhejazi
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link

gklka commented Jun 27, 2020

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

@mhdhejazi
Copy link
Owner

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?

extension RegionAnnotationView { // Pressable view
private func setTouched(_ isTouched: Bool) {
let scale = 0.9 + 0.06 * max(1, self.frame.width / 400)
let transform = isTouched ? CGAffineTransform(scaleX: scale, y: scale) : .identity
UIView.animate(withDuration: 0.4,
delay: 0.1,
usingSpringWithDamping: 0.7,
initialSpringVelocity: 1,
options: .allowUserInteraction,
animations: {
self.transform = transform
})
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
setTouched(true)
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesEnded(touches, with: event)
setTouched(false)
}
override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesCancelled(touches, with: event)
setTouched(false)
}
}

@gklka
Copy link

gklka commented Jun 27, 2020

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

@gklka
Copy link

gklka commented Jun 27, 2020

Unfortunately it did not help. :(

@mhdhejazi
Copy link
Owner

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

@wagnerand
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants