jhanarato / uposatha

Buddhist Moon Days
MIT License
1 stars 1 forks source link

Time calendar creation #12

Closed jhanarato closed 1 year ago

jhanarato commented 1 year ago

It would be good to know how long the calendar creation takes to run.

jhanarato commented 1 year ago
(venv) jr@JR-Desktop:~/Code/uposatha/src$ python -m timeit -n 1000 -s "from uposatha.calendar import Calendar" "Calendar"
1000 loops, best of 5: 8.1 nsec per loop

8 nanoseconds should be acceptable.

jhanarato commented 1 year ago

Oops. There's a bit of difference between the following:

(venv) jr@JR-Desktop:~/Code/uposatha/src$ python -m timeit -s "from uposatha.calendar import Calendar" "Calendar"
50000000 loops, best of 5: 8.53 nsec per loop
(venv) jr@JR-Desktop:~/Code/uposatha/src$ python -m timeit -s "from uposatha.calendar import Calendar" "Calendar()"
200 loops, best of 5: 1.22 msec per loop

Still, good enough.