I was runing some tests using the yield curve structure in quantlib mainly: PiecewiseYieldCurve
It seems that I have to fix the evaluation date using such a line : Settings::instance().evaluationDate() = today; or else I get difference results my test is the zSpread and OAS.
What is its role, if we already have a calendar, and we specify the reference date, and when using function like zSpread I give the date, why I still need to fix the evaluation date. Is there interior code that use it?
The second question is about the execution time of this code, I am looping over a set of date, the first time when I set the evaluation date, is quick, but then when I update it next day it become very slow like more than 5 seconds, just this line (I used debugging mode to check on it). Maybe I am doing it wrong is there another way to update it?