|
From: Amine I. <ami...@gm...> - 2020-06-05 16:13:08
|
Hi Luigi, all, I have been working on leveraging QL to create a small multi-step Monte Carlo framework which simulates market data at each future time step and calls discounting swap engine on vanilla swaps. A full Monte Carlo run with 1000 scenarios and 350 time points takes about 4min to run. I run my application through the time profiler and noticed that quite a bit of time is spent in the scenario loop where I continuously relink the yield curve handle to the appropriately simulated curve. Are there any ways/tips one could provide on where I could look for extra time savings? I found out that by using the discount(Time ) instead of the discount(Date&) variant of the method for example, one can save on the year fraction calculation, which improves the time a bit. I also de-activated a check on MaxTime() in TermStructure::checkRange() which is continuously called at each scenario. In particular, I would like to know if I could switch off the notify observers() in the Handle::linkTo() method without affecting the inner workings, as I am not interested at this stage in using the observable/observer pattern. Thanks and Regards, Amine |