We have a piece of code that calculates the PV Series for CDS (Single names and Indices) based on CdsScenarioExample.java and were noticing it would take around 130s to go through a portfolio of 2500 trades. This is slow. To make sure we were not doing anything wrong, we tried running the CdsScenarioExample.java for 2500 trades for multiple curves and it came to around 100s.
Want to get your opinion as to whether you expect these timelines and hope to make them better ? Any feedback appreciated.
The current CDS implementation is the one part of Strata that has been borrowed from our previous analytics library, and this operates in a less optimal way than the other asset classes which were all written from the ground up in Strata. In particular, curves are recalibrated during each PV calculation, which will contribute significantly to the performance you have observed.
We are currently in the process of completely rewriting this implementation in order to address these issues and make full use of Strata’s capabilities. This work is expected to be completed over the coming weeks, and will include the ability to apply scenarios using standard curve perturbations (by implementing Strata’s standard Curve interface), rather than requiring the custom implementation shown in CdsScenarioExample.