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

Scroll performance #128

Closed
ServusJon opened this issue Feb 27, 2016 · 11 comments
Closed

Scroll performance #128

ServusJon opened this issue Feb 27, 2016 · 11 comments

Comments

@ServusJon
Copy link

As already mentioned the scroll perfomance / feel on large text feels not so smooth as excepted.

@cbpowell
Copy link
Owner

Are you seeing poor performance on a device, or on the simulator? If on a device, what type(s)?

On an iPhone 6 with the sample project you provided I see a smooth framerate for the entire scroll, except for right when the animation completes and loops again - I've noted that issue here in the Swift repo.

@ServusJon
Copy link
Author

I run it on an iPhone 6 (device). It doesn’t seem to 60 frames per second. Is that possible or is it a illusion?

Am 27.02.2016 um 17:10 schrieb Charles Powell notifications@github.com:

Are you seeing poor performance on a device, or on the simulator? If on a device, what type(s)?

On an iPhone 6 with the sample project you provided I see a smooth framerate for the entire scroll, except for right when the animation completes and loops again - I've noted that issue here in the Swift repo cbpowell/MarqueeLabel-Swift#22.


Reply to this email directly or view it on GitHub #128 (comment).

@cbpowell
Copy link
Owner

Hmm it might be somewhat of an illusion? I profiled your example in Instruments and it seemed to stay at 59/60 fps on my iPhone 6, but if your actual implementation is doing other animations or CPU work it could probably affect it significantly. MarqueeLabel just fires off a CAKeyframeAnimation upon each loop and then does nothing until the next loop, so as far as I know CPU usage is really low most of the time. If you're seeing significant fps drops you might be bumping up against a Core Animation limitation?

Try making the label background a solid, opaque color and setting fadeLength to 0.0 if you can, that should give some improvements.

@ServusJon
Copy link
Author

This makes it a little better. It seems the marqueelabel cuts away some of the characters. Can I remove the limit?

@cbpowell
Copy link
Owner

cbpowell commented Mar 3, 2016

Which limit are you referring to?

@ServusJon
Copy link
Author

Character limit

Am 03.03.2016 um 22:11 schrieb Charles Powell notifications@github.com:

Which limit are you referring to?


Reply to this email directly or view it on GitHub.

@cbpowell
Copy link
Owner

cbpowell commented Mar 3, 2016

Oh the size limit that's defined here? Sure, that's there mostly to protect people that aren't aware of the limit, because if you go over the length limit of a UILabel it just doesn't draw anything. I also recently reduced the limit because apparently the 6S limit is lower. If you're not worried about that potential effect or know you won't go over, feel free to comment out that line.

If you're using extremely long strings, that could be a possible reason for your laggy scrolling. Could be pushing Core Animation too far?

@ServusJon
Copy link
Author

the lagging is also on short labels. i only discovered the truncating when i used a very longlabel. what is the characterlimit?

@cbpowell
Copy link
Owner

cbpowell commented Mar 4, 2016

There isn't a character count limit, only a size limit. The size limit is fairly big (see the link in my previous comment).

On Mar 3, 2016, 10:24 PM -0700, Jonathan Arnoldnotifications@github.com, wrote:

the lagging is also on short labels. i only discovered the truncating when i used a very longlabel. what is the characterlimit?


Reply to this email directly orview it on GitHub(#128 (comment)).

@JW97
Copy link
Contributor

JW97 commented Jun 4, 2016

#141 I've tweaked the applyGradientMask... method to have some caching/performance improvements. Seemed to somewhat improve the scrolling performance in an app I'm working on

@cbpowell
Copy link
Owner

cbpowell commented May 6, 2017

Guess I'll go ahead and consider this resolved, with no other noted issues and #141 incorporated. I can reopen if otherwise!

@cbpowell cbpowell closed this as completed May 6, 2017
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

3 participants