MCPcopy Create free account
hub / github.com/algorithmicsuperintelligence/optillm / run_performance_comparison

Function run_performance_comparison

tests/test_batching.py:399–421  ·  view source on GitHub ↗

Run a performance comparison between sequential and batch processing This function can be called separately for benchmarking

()

Source from the content-addressed store, hash-verified

397
398
399def run_performance_comparison():
400 """
401 Run a performance comparison between sequential and batch processing
402 This function can be called separately for benchmarking
403 """
404 print("Running Performance Comparison...")
405
406 test_suite = TestPerformanceBenches()
407 test_suite.setUp()
408
409 # Run performance test
410 seq_responses, seq_time = test_suite.measure_sequential_processing(test_suite.test_prompts)
411 batch_responses, batch_time = test_suite.measure_batch_processing(test_suite.test_prompts)
412
413 print(f"Sequential processing: {seq_time:.3f}s")
414 print(f"Batch processing: {batch_time:.3f}s")
415 print(f"Speedup: {seq_time/batch_time:.2f}x")
416
417 return {
418 "sequential_time": seq_time,
419 "batch_time": batch_time,
420 "speedup": seq_time/batch_time
421 }
422
423
424if __name__ == "__main__":

Callers

nothing calls this directly

Calls 4

setUpMethod · 0.95

Tested by

no test coverage detected