

If there was an easy and efficient general-purpose way to do what you're asking which works when there is no parallelism in the code, it would already be in widespread use. Single-threaded performance is extremely valuable it's much easier to write sequential code than to explicitly expose thread-level parallelism. Is such technique available for a desktop computer? If not, is it available on cloud computing platforms (AWS EC2, etc.)? Instead of having a computer's 4 CPU cores (3.3 Ghz) running "in parallel" with a total of 4 processes, is it possible to emulate one very fast single-core CPU of 13.2 Ghz (4*3.3) running one single process with the previous code? We want to check this assertion with the following pseudo-code: a = 17 This is possible for example in Python with multiprocessing module: on a 4-core CPU, it would allow to use 100% of the processing power of the computer instead of only 25% for a single-process job.īut let's say we want to make faster a non-easily-splittable computation job.Įxample: we are given a number generator function generate(n) that takes the previously-generated number as input, and "it is said to have 10^20 as period". I know that the usual method when we want to make a big math computation faster is to use multiprocessing / parallel processing: we split the job in for example 4 parts, and we let 4 CPU cores run in parallel (parallelization).
