Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant refactoring and new features to the resource pool implementation, focusing on modularizing pool types, improving the benchmarking suite, and simplifying dependencies. The changes include extracting distinct pool implementations, updating the wrapper API, expanding benchmarks to cover new pool types, and cleaning up the Rust core and dependencies.
Pool Implementation Refactor and API Changes:
GenericObjectPoolwrapper in bothindex.wrapper.cjsandindex.wrapper.mjsnow delegates to separate pool implementations:StaticObjectPool,DynamicObjectPool, andEnginePool, which are imported from new files underimplementations/. The wrapper provides static methods to instantiate each type, making the API clearer and more modular. [1] [2]exportsfield ofpackage.json, allowing consumers to import specific pool types directly. [1] [2]Benchmarking Improvements:
GenericObjectPoolin dynamic and engine modes, both for synchronous and.use()(async) usage patterns. This provides broader and more granular performance comparisons. [1] [2] [3] [4]Rust Core and Dependency Cleanup:
crossbeam-queue,once_cell) and switching toparking_lot::Mutexfor synchronization. [1] [2]GenericObjectPoolRust struct now uses a simplifiedCorePooland improves error handling, especially for closed pools, and uses a more appropriate shutdown method (closeinstead ofdrain). [1] [2] [3] [4] [5]Most Important Changes
1. Pool Implementation and API Refactor
StaticObjectPool,DynamicObjectPool, andEnginePoolimplementations, and updated the main wrapper (GenericObjectPool) to delegate instantiation and usage to these classes, improving modularity and clarity of the API. [1] [2]package.jsonto export new implementation files and allow direct imports of specific pool types. [1] [2]2. Benchmark Suite Expansion
.use()async usage patterns, and renamed existing benchmarks for clarity. [1] [2] [3] [4] [5] [6]3. Rust Core Simplification
crossbeam-queue,once_cell) and switched toparking_lot::Mutexfor synchronization in the Rust core. [1] [2]GenericObjectPoolimplementation. [1] [2] [3] [4] [5]