To Aysajan’s answer, I would add that “number of calculations a program needs to run” usually comes from a big-O estimate for the data structures involved, and the size of the data we’re using. So, for instance, if I’m looping over a list with 1k items and doing a thing to each, then that should take ~1k operations. (Really the thing I’m doing to each will probably take more than one operation, but this is a Fermi estimate, so we just need to be within an order of magnitude.) If I’m looping over all pairs of items from two lists, then the number of operations will be the product of their sizes.
For instance, a computer’s CPU is measured in GHz, which is a proxy for the number of calculations the CPU can run per second. So it is about one billion (109) calculations per second. Now let’s suppose the number of calculations your program needs to run is 106, then you can make a Fermi estimation about the program’s run time as 106109=10−3, which is millisecond. Usually we would expect the actual run time will be within an order of magnitude of this estimation.
Could you give an example of how you’d make a Fermi estimation of a program’s runtime?
To Aysajan’s answer, I would add that “number of calculations a program needs to run” usually comes from a big-O estimate for the data structures involved, and the size of the data we’re using. So, for instance, if I’m looping over a list with 1k items and doing a thing to each, then that should take ~1k operations. (Really the thing I’m doing to each will probably take more than one operation, but this is a Fermi estimate, so we just need to be within an order of magnitude.) If I’m looping over all pairs of items from two lists, then the number of operations will be the product of their sizes.
For instance, a computer’s CPU is measured in GHz, which is a proxy for the number of calculations the CPU can run per second. So it is about one billion (109) calculations per second. Now let’s suppose the number of calculations your program needs to run is 106, then you can make a Fermi estimation about the program’s run time as 106109=10−3, which is millisecond. Usually we would expect the actual run time will be within an order of magnitude of this estimation.