PyRIT
PyRIT copied to clipboard
FEAT: speed up the scoring process
Improve Scorer Performance with Concurrent Execution
Changes
- Refactored scorer execution to run concurrently using
asyncio.gather - Replaced sequential scorer execution with parallel processing
- Maintained existing validation and response handling logic
Description
The previous implementation ran scorers sequentially, which could lead to performance bottlenecks when multiple scorers were configured. By leveraging asyncio.gather, we now execute all scorers simultaneously, potentially reducing the total scoring time significantly, especially in scenarios with multiple scorers or large response batches.
Tests and Documentation
No breaking changes - this is a pure performance optimization that maintains the existing API contract.