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

CASSANDRA-20360: Improve performance of DistributedSchema.validate for large schemas #3926

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

aratno
Copy link
Contributor

@aratno aratno commented Feb 23, 2025

No description provided.

Copy link
Contributor

@beobal beobal left a comment

Choose a reason for hiding this comment

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

The AbstractBTreeMap fix looks good to me, I would just question whether is the benchmark really gains anything from the addition of the new constructor.

}

Keyspaces keyspaces = Keyspaces.of(keyspaceMetadatas.toArray(new KeyspaceMetadata[numKeyspaces]));
schema = new BenchmarkingDistributedSchema(keyspaces, Epoch.EMPTY, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Because the test is performing multiple iterations anyway, is there much to be gained by making validate conditional in the DistributedSchema constructor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to remove the constructor from the benchmark measurement because it calls BTreeMap#with for each keyspace, which isn't cheap in a loop. But both benchmarks would be including this path, so the comparison would still stand, would just have more noise. Happy to revert the test constructor change, remove the benchmark, or both - let me know what you prefer.

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