Open amirreza8002 opened 5 months ago
Thank you very much for this issue report, @amirreza8002 .
I am aware of this issue. After the Second Edition came out I developed a small library that provides samples of large integers of different magnitudes so that you can pick a magnitude that makes the example interesting each machine. Integers of 2**55 magnitude take too long on a Raspberry Pi, but take about a second on a machine with coreI9.
Please see the example in https://github.com/ramalho/python-eng/blob/main/concorrencia/primes/n_primes_proc.ipynb
I will leave this issue open until I get to this chapter while working on the Third Edition.
Thanks!
hi. so i know that you probably know this but if there will be a 3rd edition, exapmles 19-13 and 19-12 (and other examples in chapter 19) need a rework. e.g the mentioned examples actually fail to prove the point of multiprocessing being good for cpu bound work since the prime number example is done in less than a second the perf_countr() actually shows
0.00
and 19-13 actually takes longer due to multiprocessing overheadbelow is the result of running them on python 3.12.2 on a not very new xeon cpu with
perf_counter()
and this is the result using
perf_counter_ns()