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

Improve performance by caching model node index and offset in Node and NodeList #17296

Merged
merged 26 commits into from
Oct 23, 2024

Conversation

scofalik
Copy link
Contributor

Suggested merge commit message (convention)

Feature (engine): Introduced getChildAtOffset() method for model.Element and model.DocumentFragment.

Feature (engine): Introduced Position#isValid() to check whether the position exists in current model tree.

Other (engine): Node index and offset related values are now cached in model Node and NodeList to improve performance.

Internal (engine): Used Position#isValid() to better validate selection ranges.

Tests (engine): Changed error messages expected in some tests. Now different errors may be thrown than earlier because internal execution logic changed a bit. New error codes are more precicse.


Additional information

Based on: #17205

scofalik and others added 20 commits October 3, 2024 15:38
Added button to start the test, instead starting it automatically, so CI does not wait for it.
Changed structure a bit, again.
Removed existing `editorinit.html` test to prevent confusion.
…lement` and `model.DocumentFragment`.

Other (engine): Node index and offset related values are now cached in `Node` and `NodeList` to improve performance.
…e position exists in current model tree.

Internal (engine): Used `Position#isValid()` to better validate selection ranges.
Tests (engine): Changed error messages expected in some tests. Now different errors may be thrown than earlier because internal execution logic changed a bit. New error codes are more precicse.
@niegowski niegowski changed the base branch from master to cc/performance-research-base October 22, 2024 10:51
packages/ckeditor5-engine/src/model/nodelist.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/model/nodelist.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/model/nodelist.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/model/nodelist.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/model/position.ts Outdated Show resolved Hide resolved
packages/ckeditor5-engine/src/model/position.ts Outdated Show resolved Hide resolved
Co-authored-by: Kuba Niegowski <1232187+niegowski@users.noreply.github.com>
Base automatically changed from cc/performance-research-base to master October 22, 2024 12:15
@Dumluregn Dumluregn merged commit d874050 into master Oct 23, 2024
10 checks passed
@Dumluregn Dumluregn deleted the cc/performance-offsets branch October 23, 2024 13:20
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.

4 participants