Skip to content

feat: enhanced performance when async (throttle) (#399)#400

Merged
petruki merged 1 commit into
masterfrom
staging
Jun 30, 2026
Merged

feat: enhanced performance when async (throttle) (#399)#400
petruki merged 1 commit into
masterfrom
staging

Conversation

@petruki

@petruki petruki commented Jun 30, 2026

Copy link
Copy Markdown
Member

This pull request introduces several improvements and refactorings to the Switcher client. The main changes focus on dependency management, thread usage for async operations, and code simplification for better readability and performance.

Dependency updates:

  • Updated the test dependency in pom.xml to use mockwebserver3-junit5 instead of separate okhttp and mockwebserver dependencies, streamlining test dependencies.
  • Bumped the project version in pom.xml from 1.10.0 to 1.10.1-SNAPSHOT to reflect ongoing development.

Async execution improvements:

  • Changed the executor in AsyncSwitcher from a cached thread pool to a single-threaded executor to avoid unnecessary thread creation and improve resource management.
  • Refactored the execute() method in AsyncSwitcher to reduce redundant calls to System.currentTimeMillis() and improve logging clarity.

Code simplification and cleanup:

  • Simplified null checks in SwitcherRequest by replacing Objects.isNull/Objects.nonNull with direct null comparisons, and improved bypass logic for clarity and efficiency. [1] [2]

@petruki petruki added this to the v1.10.1 milestone Jun 30, 2026
@petruki petruki self-assigned this Jun 30, 2026
@petruki petruki added the enhancement New feature or request label Jun 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

@petruki petruki merged commit 7325c36 into master Jun 30, 2026
23 of 24 checks passed
@petruki petruki deleted the staging branch June 30, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant