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

feat: Faster Cursors #118

Merged
merged 9 commits into from
Sep 20, 2018
Merged

feat: Faster Cursors #118

merged 9 commits into from
Sep 20, 2018

Conversation

ognen
Copy link
Member

@ognen ognen commented Sep 20, 2018

This pull requests resolves #115.

The immutable/contrib/cursor implementation has been refined so that each cursor holds a pointer to the current data object in addition to root and keyPath. This makes getIn and especially get lookups 10x faster than before. As render methods usually are quite heavy in get calls, this should improve rendering significantly.

BREAKING CHANGE
The new cursor intentonally disallows storing cursors inside cursor
to warn against difficuilt to track situations that can lead to infinite loops.
Consequently the intenal redux store now keeps a vanilla immutable
structure as state rather than a cursor. This shouldn't cause
trouble except in redux middleware where the state is accessed
directly.
05b323a

BREAKING CHANGE
The new cursor intentonally disallows storing cursors inside cursor
to warn against difficuilt to track situations that can lead to infinite loops.
Consequently the intenal redux store now keeps a vanilla immutable
structure as `state` rather than a cursor. This shouldn't cause
trouble except in redux middleware where the state is accessed
directly.
@ognen ognen requested a review from andon September 20, 2018 12:50
@coveralls
Copy link

Pull Request Test Coverage Report for Build 355

  • 33 of 41 (80.49%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 77.569%

Changes Missing Coverage Covered Lines Changed/Added Lines %
scripts/test-setup.js 4 7 57.14%
packages/classic/src/update/impl.js 10 15 66.67%
Totals Coverage Status
Change from base Build 352: -0.3%
Covered Lines: 1010
Relevant Lines: 1226

💛 - Coveralls

@ognen ognen merged commit 7874fae into master Sep 20, 2018
@ognen ognen deleted the improvement/performance-faster-cursors branch September 20, 2018 12:57
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

Successfully merging this pull request may close these issues.

Optimize read access (get / getIn) of cursors
2 participants