Summary
execute_graphql_query in gittensor/utils/github_api_tools.py uses top-level requests.post calls, so every invocation pays a fresh TCP + TLS handshake to api.github.com. This affects all GraphQL callers, including find_solver_from_cross_references → _search_issue_referencing_prs_graphql → execute_graphql_query.
Proposed improvement:
- Add an optional
session: Optional[requests.Session] = None parameter to execute_graphql_query, _search_issue_referencing_prs_graphql, and find_solver_from_cross_references.
- When a session is provided, use
session.post(...) instead of requests.post(...) so urllib3 reuses the underlying connection pool.
- Default
None preserves all existing callers and tests unchanged; this is a transport-layer optimization only.
Motivation
Any hot path that issues multiple GraphQL calls per round (issue discovery, solver lookups, etc.) benefits from connection reuse. Session pooling would:
- Reduce repeated TCP/TLS setup overhead per call.
- Improve wall-clock latency stability under load.
- Lower avoidable CPU/network overhead without changing scoring logic.
This is complementary to #687, which applies the same pooling idea to the OSS miner-scoring path.
Summary
execute_graphql_queryingittensor/utils/github_api_tools.pyuses top-levelrequests.postcalls, so every invocation pays a fresh TCP + TLS handshake toapi.github.com. This affects all GraphQL callers, includingfind_solver_from_cross_references→_search_issue_referencing_prs_graphql→execute_graphql_query.Proposed improvement:
session: Optional[requests.Session] = Noneparameter toexecute_graphql_query,_search_issue_referencing_prs_graphql, andfind_solver_from_cross_references.session.post(...)instead ofrequests.post(...)so urllib3 reuses the underlying connection pool.Nonepreserves all existing callers and tests unchanged; this is a transport-layer optimization only.Motivation
Any hot path that issues multiple GraphQL calls per round (issue discovery, solver lookups, etc.) benefits from connection reuse. Session pooling would:
This is complementary to #687, which applies the same pooling idea to the OSS miner-scoring path.