Benchmark jsii Python module vs native counterpart
- run
cd native-python
- run
pip install -r requirements.txt
- run
python -m timeit "import benchmark; benchmark.my_function()"
native module timeit results:
- From an AWS Workspaces VM with 4 Cores and 8 GiB RAM running Windows 10 (and Ubuntu 19.10 WSL).
2000 loops, best of 5: 117 usec per loop
- From a 2019 MacBook Pro with 2.8 GHz Intel Core i7 and 16GiB RAM running macOS Mojave.
5000 loops, best of 5: 69.4 usec per loop
- run
cd jsii-python
- run
pip install -r requirements.txt
- run
python -m timeit "import benchmark; benchmark.my_function()"
jsii module timeit results:
- From an AWS Workspaces VM with 4 Cores and 8 GiB RAM running Windows 10 (and Ubuntu 19.10 WSL).
1 loop, best of 5: 14 msec per loop
- From a 2019 MacBook Pro with 2.8 GHz Intel Core i7 and 16GiB RAM running macOS Mojave.
50 loops, best of 5: 6.7 msec per loop
P.S.: Thanks to this detailed article for the help with benchmarking Python code
This library is licensed under the MIT-0 License. See the LICENSE file.