W
Walter Roberson
|> That's a good thought, but my profiling experiments on his code show
|> that the amount of time spent in those areas is in the noise level,
|> with the arithmetic functions of the routine the OP indicate
|> being the bottleneck.
|Did you profile for _large_ Fib numbers, numbers much greater than can be
|represented by ordinary 'long', which is what the code seems to be all about?
75000
:And does your profiler account for out-of-process time such as e.g. swapping?
I was using a hardware program counter sampler, so out-of-band times
would not have been included.
The system I was running on has over a gigabyte of available memory.. it
would take rather some time to get to the point of swapping.
rofiling is a tricky business, and without analyzing that code in detail
I just skimmed it) it seemed to me have at least O(n log n) memory
:consumption for computation of a Fib number number n...
Experimentally, it is O(n^2) in time.
O(n log n) would take about n = 2^26 to fill a gigabyte.
On the system I am testing on (which is a decade old, 250 MHz),
the lapsed time is fairly close to 1 minute for n = 150000.
At that rate, it would take very close to 139 days of computation
to fill a gigabyte.
Other architectures would, of course, have different constants of
proportionality.
|> that the amount of time spent in those areas is in the noise level,
|> with the arithmetic functions of the routine the OP indicate
|> being the bottleneck.
|Did you profile for _large_ Fib numbers, numbers much greater than can be
|represented by ordinary 'long', which is what the code seems to be all about?
75000
:And does your profiler account for out-of-process time such as e.g. swapping?
I was using a hardware program counter sampler, so out-of-band times
would not have been included.
The system I was running on has over a gigabyte of available memory.. it
would take rather some time to get to the point of swapping.
rofiling is a tricky business, and without analyzing that code in detail
I just skimmed it) it seemed to me have at least O(n log n) memory
:consumption for computation of a Fib number number n...
Experimentally, it is O(n^2) in time.
O(n log n) would take about n = 2^26 to fill a gigabyte.
On the system I am testing on (which is a decade old, 250 MHz),
the lapsed time is fairly close to 1 minute for n = 150000.
At that rate, it would take very close to 139 days of computation
to fill a gigabyte.
Other architectures would, of course, have different constants of
proportionality.