Skip to content

CAMEL-21888: camel-core - Compute cache changes size#17546

Merged
essobedo merged 1 commit intomainfrom
essobedo/CAMEL-21888/compute-cache-changes-size
Mar 23, 2025
Merged

CAMEL-21888: camel-core - Compute cache changes size#17546
essobedo merged 1 commit intomainfrom
essobedo/CAMEL-21888/compute-cache-changes-size

Conversation

@essobedo
Copy link
Contributor

@essobedo essobedo commented Mar 23, 2025

Fix for https://issues.apache.org/jira/browse/CAMEL-21888

Motivation

Iterating over all the changes to get size is very costly in case of a big cache size. Using a counter to have the size of changes was initially avoided for consistency issues reason, but the addition lately of a ReadWriteLock allows us to put it back

Modifications:

  • Avoid an O(N) to get the size of the changes by counting them using an AtomicInteger.

@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@essobedo essobedo merged commit 0726680 into main Mar 23, 2025
5 checks passed
@davsclaus davsclaus deleted the essobedo/CAMEL-21888/compute-cache-changes-size branch April 19, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant