()
| 207 | |
| 208 | # ---------------------- Benchmark Report ---------------------- |
| 209 | def main(): |
| 210 | print("Python Performance Benchmark") |
| 211 | print("Measure Unit: Operations Per Second (OPS)\n") |
| 212 | |
| 213 | print(f"Sequential Simple Execution: {test_sequential_exec(5)}") |
| 214 | print(f"Sequential Function Calling: {test_sequential_fcall(5)}") |
| 215 | print(f"Recursive Function Calling: {test_recursion(5, 10)}") |
| 216 | print( |
| 217 | f"Fiber Context Switching: {asyncio.run(test_context_switch_async(5, 5))}" |
| 218 | ) |
| 219 | print(f"Complex Math Operations: {test_math_ops(5, 5)}") |
| 220 | print(f"String Concatenation: {test_string_ops(5, 5)}") |
| 221 | print(f"Random Array Access: {test_array_index(5, 100000)}") |
| 222 | print(f"Random Hash Access: {test_hash_index(5, 100000)}") |
| 223 | print(f"Array Quicksort: {test_quicksort(5, 10000)}") |
| 224 | |
| 225 | print("\nBenchmark Finished\n") |
| 226 | |
| 227 | |
| 228 | if __name__ == "__main__": |
no test coverage detected