Skip to content

Improve performance bottlenecks#149

Merged
galt-tr merged 2 commits into
mainfrom
perfFixes
May 14, 2026
Merged

Improve performance bottlenecks#149
galt-tr merged 2 commits into
mainfrom
perfFixes

Conversation

@galt-tr
Copy link
Copy Markdown
Contributor

@galt-tr galt-tr commented May 14, 2026

This pull request introduces significant optimizations and configurability improvements to the transaction propagation pipeline, with a focus on reducing end-to-end latency and improving throughput under high load. The most important changes include making the broadcast worker pool and parallel chunking configurable, adding an in-memory prefilter to skip stale callback work, and documenting the impact of these changes. These updates collectively reduce the mean RECEIVED → ACCEPTED_BY_NETWORK latency by 88% and minimize wasted store reads.

Pipeline Configuration Improvements

  • config/config.go, services/propagation/propagator.go: Promoted the broadcast worker pool size (BroadcastWorkers) and maximum parallel chunk count (MaxParallelChunks) from constants to configuration options, with sensible defaults and documentation. This allows tuning for different deployment sizes and workloads. [1] [2] [3] [4] [5] [6] [7] [8]

Performance Optimizations

  • services/api_server/handlers.go: Added an in-memory tracker prefilter to the callback handler, which skips updating the store for callback txids whose status is already at or past the callback target. This eliminates unnecessary store operations for ~91% of SEEN_ON_NETWORK callbacks at 100 TPS, significantly reducing hot-path load. [1] [2] [3]
  • services/api_server/handlers_test.go: Added a test to verify that the tracker prefilter correctly skips stale callback txids and only applies updates for fresh or unknown statuses. [1] [2]

Documentation

  • docs/100tps-propagation-results.md: Added a comprehensive document detailing the optimization results, pipeline breakdown, and the effect of each shipped change on latency and throughput, including visualizations and metric explanations.

These changes collectively make the transaction propagation pipeline faster, more efficient, and easier to tune for various deployment scenarios.

@galt-tr galt-tr requested a review from mrz1836 as a code owner May 14, 2026 12:48
@github-actions github-actions Bot added size/L Large change (201–500 lines) performance Performance improvements or optimizations refactor Any significant refactoring labels May 14, 2026
Copy link
Copy Markdown
Collaborator

@mrz1836 mrz1836 left a comment

Choose a reason for hiding this comment

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

LGTM

@galt-tr galt-tr merged commit 25d470f into main May 14, 2026
52 checks passed
@galt-tr galt-tr deleted the perfFixes branch May 14, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance improvements or optimizations refactor Any significant refactoring size/L Large change (201–500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants