Skip to content

Comments

perf: reuse HTTP connexions between sessions#325

Open
bolinocroustibat wants to merge 8 commits intomainfrom
keep-http-client
Open

perf: reuse HTTP connexions between sessions#325
bolinocroustibat wants to merge 8 commits intomainfrom
keep-http-client

Conversation

@bolinocroustibat
Copy link
Contributor

@bolinocroustibat bolinocroustibat commented Aug 29, 2025

Reuse HTTP connexions between sessions

Refactors the HTTP client usage so that the application relies on a shared aiohttp.ClientSession instead of creating a new session for every request. This should reduce connection-setup overhead and enable connection pooling. Even though we currently don’t make many consecutive requests to the same host — so the impact will be limited for now — using a shared client keeps things consistent, more readable, and prepares us for scenarios where reuse matters.

Changes:
• Introduce centralized HTTP client management in utils/http.py.
• Replace direct ClientSession instantiations with calls to get_http_client().

Benchmarks:
See benchmarks in this PR on another repo. Additional benchmarking with many successive requests to the same server would better quantify the performance gains.

@bolinocroustibat bolinocroustibat requested review from Pierlou and maudetes and removed request for Pierlou August 29, 2025 13:47
@bolinocroustibat bolinocroustibat changed the title feat: add get_http_client function feat: reuse HTTP connexions between sessions Aug 29, 2025
@bolinocroustibat bolinocroustibat self-assigned this Aug 29, 2025
@bolinocroustibat bolinocroustibat changed the title feat: reuse HTTP connexions between sessions perf: reuse HTTP connexions between sessions Sep 1, 2025
bolinocroustibat and others added 4 commits September 5, 2025 12:46
# Conflicts:
#	CHANGELOG.md
#	udata_hydra/crawl/check_resources.py
#	udata_hydra/routes/checks.py
#	udata_hydra/utils/file.py
# Conflicts:
#	CHANGELOG.md
# Conflicts:
#	CHANGELOG.md
@gitguardian
Copy link

gitguardian bot commented Oct 2, 2025

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@bolinocroustibat bolinocroustibat added the code quality Indique qu'il s'agit d'une amélioration de la qualité du code (au sens très large) label Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Indique qu'il s'agit d'une amélioration de la qualité du code (au sens très large)

Projects

Status: 👀 Review

Development

Successfully merging this pull request may close these issues.

1 participant