Debian Codegraph @

docs/performance.rst

raw
1 Performance
2 ===========
3
4 At this time, we have focused mostly on implementing functionality into the
5 **astropy-healpix** package, performance is not as good in most
6 cases as the `healpy <https://github.com/healpy/healpy>`__ library. Once
7 the API is stable, we will focus on improving performance.
8
9 Benchmark
10 ---------
11
12 To get an idea of
13 how the performance of the two packages compare, we have included some simple
14 benchmarks that compare the healpy-compatible interface of **astropy-healpix**
15 with healpy itself. These benchmarks are run with:
16
17 .. code-block:: bash
18
19 $ python -m astropy_healpix.bench
20 Running benchmarks...
21
22 fct nest nside size time_healpy time_self ratio
23 ------- ----- ----- ------- ----------- ---------- -------
24 pix2ang True 1 10 0.0000081 0.0003575 43.91
25 pix2ang True 128 10 0.0000082 0.0003471 42.52
26 pix2ang True 1 1000 0.0000399 0.0004751 11.92
27 pix2ang True 128 1000 0.0000345 0.0004575 13.28
28 pix2ang True 1 1000000 0.0434032 0.1589150 3.66
29 pix2ang True 128 1000000 0.0364285 0.1383810 3.80
30 pix2ang False 1 10 0.0000080 0.0004040 50.30
31 pix2ang False 128 10 0.0000082 0.0003322 40.63
32 pix2ang False 1 1000 0.0000400 0.0005005 12.50
33 pix2ang False 128 1000 0.0000548 0.0005045 9.21
34 pix2ang False 1 1000000 0.0342841 0.1429310 4.17
35 pix2ang False 128 1000000 0.0478645 0.1405270 2.94
36
37 For small arrays, ``pix2ang`` in **astropy-healpix** performs worse, but in both
38 caes the times are less than a millisecond, and such differences may therefore
39 not matter. For larger arrays, the difference is a factor of a few at most.
40 We will add more benchmarks over time to provide a more complete picture.