June 4th, 2010, 12:08 pm
QuoteThe 10x slowdown might give the illusion that if you do a 1.000.000 scenario MC run that takes 5 seconds, and does 1.000.000 virtual function call, that you'll have 4.5 sec overhead! In reality the 1.000.000 function calls would (on my machine) give 0.001sec overhead and *so* the slowdown is actually irreleveant / not worth optimizing for this case.The only way is to experiment. This is a small scale problem.Consider a 3 factor PDE that we model with 3 diffusion, 2 drift and 3 correlation coefficients and 1 reaction term. These functions will be called NX x NY x NZ x NT times (typical values == 20, depending on how good the fd scheme is; the value could be 400, 500).This is an appreciable part is the algorithm, in total 10 x NX x NY x NZ x NT function calls. Let's say 10^9 calculations. I have excluded functions in the boundary conditions in my forrmula (6 faces ==> 6 x NT calcs).
Last edited by
Cuchulainn on June 3rd, 2010, 10:00 pm, edited 1 time in total.