Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

aws-samples/jsii-python-benchmarking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

jsii-python-benchmarking

Benchmark jsii Python module vs native counterpart

Benchmark native Python

  1. run cd native-python
  2. run pip install -r requirements.txt
  3. run python -m timeit "import benchmark; benchmark.my_function()"

native module timeit results:

  1. 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
  1. 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

Benchmark jsii Python

  1. run cd jsii-python
  2. run pip install -r requirements.txt
  3. run python -m timeit "import benchmark; benchmark.my_function()"

jsii module timeit results:

  1. 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
  1. 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

License

This library is licensed under the MIT-0 License. See the LICENSE file.