Commit 57107b2
[numba.md] numba_ex3: run the solution at the n the exercise asks for
The statement says to use a substantial sample size such as
n = 100_000_000, but the solution reused the shared 10^6 arrays --- at
that size both timed cells display as 0.00 seconds, demonstrating
nothing. The solution now draws its own 10^8 points (with a memory
note), times the parallel version, and compares against speed_ex1's
serial jitted function on the same arrays so the multithreading gain
is visible on the page.
The shared 10^6 arrays are unchanged: speed_ex1's pure-Python
comparison would take minutes at 10^8.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 969028b commit 57107b2
1 file changed
Lines changed: 32 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
727 | 744 | | |
728 | 745 | | |
729 | 746 | | |
730 | | - | |
| 747 | + | |
731 | 748 | | |
732 | 749 | | |
733 | 750 | | |
734 | 751 | | |
735 | | - | |
| 752 | + | |
736 | 753 | | |
737 | 754 | | |
738 | | - | |
739 | | - | |
740 | | - | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
741 | 762 | | |
742 | | - | |
743 | | - | |
| 763 | + | |
| 764 | + | |
744 | 765 | | |
745 | 766 | | |
746 | | - | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
747 | 770 | | |
748 | 771 | | |
749 | 772 | | |
| |||
0 commit comments