big_O
big_O copied to clipboard
Python module to estimate big-O time complexity from execution time
In the [zipp project](/jaraco/zipp) (part of CPython's stdlib), I've [employed big O](https://github.com/jaraco/zipp/blob/main/tests/test_complexity.py) to test the complexity of `zipp.CompleteDirs._implied_dirs`. The tests [fail intermittently](https://github.com/jaraco/zipp/issues/104), particularly on slower platforms (macOS, Windows, PyPy) but...
It would be nice if all of the raw data could be passed back if requested instead of only the minimum (for executions with `n_repeats>1`) https://github.com/pberkes/big_O/blob/d7004253ddd62c6d19e66d1e0ceead77a79bc615/big_o/big_o.py#L61 So one could calculate...
When calculating the complexity, I got the following results: ``` Best : Exponential: time = 0.036 * 1^n (sec) Constant: time = 0.5 (sec) (res: 5.5) Linear: time = -0.43...