PyRIT icon indicating copy to clipboard operation
PyRIT copied to clipboard

FEAT: speed up the scoring process

Open ayeganov opened this issue 10 months ago • 0 comments

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.

ayeganov avatar Mar 18 '25 20:03 ayeganov