Benchmark a function with realistic load
Benchmark a function across small, medium, and large input sizes to measure ops/sec and memory allocation. Identifies the scale at which performance degrades.
Preview
Copy prompt
Write a benchmark for the following function using [Benchmark.js / go test -bench / pytest-benchmark / hyperfine]: [Paste code]. Run the benchmark with three representative input sizes — small (around 10 items), medium (around 1,000 items), and large (around 100,000 items). Report ops/sec or execution time and memory allocation for each size class. Identify and explain the input scale at which performance noticeably degrades and suggest the likely algorithmic cause.
More
Testing
Prompts
