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

XWIKI-22577: Cloning documents with many XObjects and high object numbers is slow #3596

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

tmortagne
Copy link
Member

Jira URL

https://jira.xwiki.org/browse/XWIKI-22577

Changes

Description

Trying to speed up the xobjects part of the document cloning.

Clarifications

  • speed up DocumentReference#compareTo implementation, which is used when accessing xobjects
  • optimize xobject cloning to avoid going through public add for each xobject and especially skip the manipulation of "null entries"

Executed Tests

Not really any new test, since xobject cloning is well covered already, and it's not easy to test performances through automated testing.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches: 15.10.x, 16.10.x

return 1;
}

if (value.getClass() == otherValue.getClass() && value instanceof Comparable comparableValue) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment but I think the construct value instanceof Comparable comparableValue is more recent than java 11 and so cannot be backported to 15.10.x as it is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed. I'd better make sure to use a Java 11 compatible code for now.

@tmortagne tmortagne merged commit f2f962c into master Oct 28, 2024
1 check passed
@tmortagne tmortagne deleted the feature-XWIKI-22577 branch October 28, 2024 16:12
tmortagne added a commit that referenced this pull request Oct 28, 2024
tmortagne added a commit that referenced this pull request Oct 28, 2024
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.

2 participants