issue_comments: 539218376
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/issues/2799#issuecomment-539218376 | https://api.github.com/repos/pydata/xarray/issues/2799 | 539218376 | MDEyOklzc3VlQ29tbWVudDUzOTIxODM3Ng== | 6213168 | 2019-10-07T21:46:32Z | 2019-10-07T21:53:33Z | MEMBER | I tried playing around with pypy 3.6. Big fat disclaimer: I did not run any of the xarray unit tests. Expect trouble if you do. 1. ```bash !/bin/bashset -o errexit set -o pipefail set -o nounset set -o xtrace tar -xvjf Downloads/pypy3.6-v7.1.1-linux64.tar.bz2 cd pypy3.6-v7.1.1-linux64/bin ./pypy3 -m ensurepip ./pip3.6 install -U pip wheel ./pip list | awk 'NR > 2 {print $1}' | grep -v greenlet | xargs ./pip install -U sudo apt-get install libopenblas-dev gfortran./pip install numpy pandas xarray
import numpy as np import xarray as xr shape = (10, 10, 10, 10) index = (0, 0, 0, 0) np_arr = np.ones(shape) arr = xr.DataArray(np_arr) N = 10000 def bench_slice(obj): for _ in range(4): t0 = time.time() for _ in range(N): obj[index] t1 = time.time() t_ns = (t1 - t0) / N * 1e9 print(f"{t_ns:6.0f} ns {obj.class.name}") bench_slice(arr) bench_slice(np_arr) ``` Benchmark outputs:
CPython 3.7:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
416962458 |