Skip to content

enhance cgo future manager sharding with 32-core groups - #2

Closed
CLiqing wants to merge 1 commit into
masterfrom
perf/buf256-shard32-pr
Closed

enhance cgo future manager sharding with 32-core groups#2
CLiqing wants to merge 1 commit into
masterfrom
perf/buf256-shard32-pr

Conversation

@CLiqing

@CLiqing CLiqing commented Apr 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • increase defaultRegisterBuf from 1 to 256 for active future registration
  • shard activeFutureManager by CPU groups (numShards = cpuNum/32, min 1 shard) and route registrations round-robin
  • update TestConcurrent to aggregate active future counts across all shards

Test plan

  • sudo DOCKER_CONFIG=/tmp/docker-anon -E ./build/builder.sh /bin/bash -c \"set -euo pipefail; source scripts/setenv.sh; go test -tags test -run 'TestFutureWithSuccessCase|TestFutures|TestConcurrent' -v ./internal/util/cgo\"
  • Verified PR diff only touches:
    • internal/util/cgo/manager_active.go
    • internal/util/cgo/futures.go
    • internal/util/cgo/futures_test.go
  • Verified PR branch is based on latest origin/master and excludes serial FillPrimaryKey rollback changes

🤖 Generated with Claude Code

Use a 256-slot register buffer and route future registration across
`cpuNum/32` managers (minimum 1 shard) to reduce single-manager
contention in the cancel/select loop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CLiqing CLiqing closed this Apr 15, 2026
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.

1 participant