Skip to content

Commit

Permalink
Notebook cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tuokri committed Jul 11, 2024
1 parent 75fce37 commit 0a26019
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions DevUtils/numba_gmpy2_benchmarks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "f9658e34-04f9-439c-a54b-f9b17a4730e1",
"metadata": {},
"outputs": [],
Expand All @@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "5fec4995-b398-41e2-a267-3ce325c71ada",
"metadata": {},
"outputs": [],
Expand All @@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": null,
"id": "bc392285-2d91-4553-b30c-8bb8f784330c",
"metadata": {},
"outputs": [],
Expand All @@ -39,13 +39,12 @@
" if x.is_divisible(65537):\n",
" continue\n",
" x += 1\n",
" return x\n",
" break"
" return x"
]
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": null,
"id": "a513076a-e856-4fc3-9469-52644ed90e94",
"metadata": {},
"outputs": [],
Expand All @@ -61,27 +60,18 @@
" if x.is_divisible(65537):\n",
" continue\n",
" x += 1\n",
" return x\n",
" break"
" return x"
]
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": null,
"id": "7e8aab78-7c4e-4ef7-a7b8-0be2869acb33",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"5.12 ms ± 106 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
]
}
],
"outputs": [],
"source": [
"%%timeit\n",
"for i in range(2, 128 + 1):\n",
"for i in range(2, 16 + 1):\n",
" rand_prime(rng, i)"
]
},
Expand All @@ -93,7 +83,7 @@
"outputs": [],
"source": [
"%%timeit\n",
"for i in range(2, 128 + 1):\n",
"for i in range(2, 16 + 1):\n",
" x = gmpy2.mpz_urandomb(rng, i - 1)\n",
" rand_prime_numba(x, i)"
]
Expand Down

0 comments on commit 0a26019

Please sign in to comment.