Skip to content

Commit a58a11d

Browse files
authored
feat: implement object pooling for PluginPipeline to improve performance (#146)
# Implement Object Pooling for PluginPipeline This PR adds object pooling for `PluginPipeline` objects to improve performance by reducing memory allocations and garbage collection overhead. The implementation: 1. Adds a new `pluginPipelinePool` to the `Bifrost` struct 2. Implements methods to get, reset, and release pipeline objects 3. Prewarms the pool during initialization 4. Refactors the request handling code to use pooled pipelines Additionally, this PR: - Extracts common validation logic into a `validateRequest` helper function - Moves utility functions like `providerRequiresKey` and `calculateBackoff` to the utils.go file - Consolidates the try* methods into a single `tryRequest` function - Simplifies the request handling flow These changes should reduce memory pressure and improve performance for high-throughput scenarios.
2 parents 7240a5e + 56a50ff commit a58a11d

File tree

2 files changed

+743
-732
lines changed

2 files changed

+743
-732
lines changed

0 commit comments

Comments
 (0)