You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/numba.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,15 +227,13 @@ This is equivalent to adding `qm = jit(qm)` after the function definition.
227
227
The following now uses the jitted version:
228
228
229
229
```{code-cell} ipython3
230
-
%%time
231
-
232
-
qm(0.1, 100_000)
230
+
with qe.Timer():
231
+
qm(0.1, 100_000)
233
232
```
234
233
235
234
```{code-cell} ipython3
236
-
%%time
237
-
238
-
qm(0.1, 100_000)
235
+
with qe.Timer():
236
+
qm(0.1, 100_000)
239
237
```
240
238
241
239
Numba also provides several arguments for decorators to accelerate computation and cache functions -- see [here](https://numba.readthedocs.io/en/stable/user/performance-tips.html).
@@ -291,7 +289,8 @@ We can fix this error easily in this case by compiling `mean`.
0 commit comments