Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Heavy CPU utilization on scrolling with springinessEnabled #281

Closed
davidchiles opened this issue May 13, 2014 · 8 comments
Closed

Heavy CPU utilization on scrolling with springinessEnabled #281

davidchiles opened this issue May 13, 2014 · 8 comments

Comments

@davidchiles
Copy link
Contributor

I tested the example app on an iPhone 5s after loading a few messages scrolling pegs the CPU ~98% and causes some stuttering. Looking at instruments the culprit looks to be [UICollectionView layoutSubviews].

@davidchiles
Copy link
Contributor Author

self.collectionView.collectionViewLayout.springinessEnabled = NO; helps a lot. The CPU utilization is closer ~20%.

@jessesquires
Copy link
Owner

@davidchiles - yeah there's a lot going on with UIDynamics. I've tried to optimize as much as possible.

@jessesquires jessesquires changed the title Heavy CPU utilization on scrolling Heavy CPU utilization on scrolling with springinessEnabled May 13, 2014
@arieldemi
Copy link

Hi, is there a plan to improve the performance of the dynamics?

@jessesquires
Copy link
Owner

@arieldemi - yes, eventually. PRs are welcome 😄

if dynamics are causing issues for you, i would disable for now

@arieldemi
Copy link

Thank you Jesse

@jessesquires
Copy link
Owner

@davidchiles / @arieldemi - I'm curious to know how UIDynamics performs in general with regard to CPU utilization.

@erysaj
Copy link
Contributor

erysaj commented May 21, 2014

I'm working on this issue, PR is to be expected soon (in a few days I guess)

@jessesquires
Copy link
Owner

nice! thanks @erysaj !

andrewchae pushed a commit to andrewchae/JSQMessagesViewController that referenced this issue Jun 5, 2014
…5_ac

* commit '178e1a5ab8bcea330e63a2c760aa53e7863dd80f': (38 commits)
  v 5.0.4
  update cocoadocs styles
  update cocoadocs style
  pod update
  cocoadocs.yml
  v 5.0.3
  update library common header for new context object
  fix docs and formatting and minor refactoring from PR jessesquires#313. small improvements to lazily applying layout attributes to cells. close jessesquires#306. close jessesquires#281.
  schemes
  Update README.md
  Revert "avoid expensive view hierarchy modification during cell configuration"
  switch to NSParameterAssert where appropriate
  add userInfo dictionary to keyboard notification so that it is actually useful. jessesquires#287.
  avoid expensive view hierarchy modification during cell configuration
  do not use concurrent enumeration
  lazily update cell’s text view
  lazily update cell’s layout constraints
  use custom layout invalidation context to suppress unneeded computations
  pod update
  update version nums. update spec.
  ...

Conflicts:
	JSQMessagesViewController/Controllers/JSQMessagesKeyboardController.m
	JSQMessagesViewController/Views/JSQMessagesCollectionViewCell.m
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants