Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Week10 - Measuring performance and using numpy#193

Open
AhmadUCL wants to merge 2 commits intoUCL-RITS:week10from
AhmadUCL:week10
Open

Week10 - Measuring performance and using numpy#193
AhmadUCL wants to merge 2 commits intoUCL-RITS:week10from
AhmadUCL:week10

Conversation

@AhmadUCL
Copy link
Copy Markdown

@AhmadUCL AhmadUCL commented Dec 17, 2020

Original code

$ python -m timeit -n 100 -r 5 -s "from calc_pi import calculate_pi_timeit" "calculate_pi_timeit(10_000)()"
100 loops, best of 5: 14.3 msec per loop

Updated code (using numpy)

$ python -m timeit -n 100 -r 5 -s "from calc_pi_np import calculate_pi_timeit" "calculate_pi_timeit(10_000)()"
100 loops, best of 5: 883 usec per loop

Numpy version is much faster but for whatever reason line 63 gives me an error in the numpy version so I had to comment it out

Measuring performance and using numpy #185

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant