Did you solve this one? I once had a problem with the speed of an algo that kept being called. I instead just filled out a table with the necessary outputs, so the calculation happened once, and then a lookup was performed - much faster and happened to work well in that specific example.I thought it was a pun, and so I reciprocated (I'm using C++11 and up) :-)Like I said, my issue is speed. Date calculations are not a significant part of the program logic, but they take a large fraction of the total execution time, hence my candidate for optimisation...
Thanks for the suggestion, but your case was probably something to do with swap pricing, where the number of dates was relatively small. In my case I have to do calculations on a large set of dates, so caching doesn't give any performance benefit (I tried it - cache lookups were even more expensive than date calculations).Did you solve this one? I once had a problem with the speed of an algo that kept being called. I instead just filled out a table with the necessary outputs, so the calculation happened once, and then a lookup was performed - much faster and happened to work well in that specific example.I thought it was a pun, and so I reciprocated (I'm using C++11 and up) :-)Like I said, my issue is speed. Date calculations are not a significant part of the program logic, but they take a large fraction of the total execution time, hence my candidate for optimisation...
Might there be a way to pre-process the raw data so that all dates are in some linear simple data type (e.g., 64-bit nanoseconds)?Thanks for the suggestion, but your case was probably something to do with swap pricing, where the number of dates was relatively small. In my case I have to do calculations on a large set of dates, so caching doesn't give any performance benefit (I tried it - cache lookups were even more expensive than date calculations).Did you solve this one? I once had a problem with the speed of an algo that kept being called. I instead just filled out a table with the necessary outputs, so the calculation happened once, and then a lookup was performed - much faster and happened to work well in that specific example.I thought it was a pun, and so I reciprocated (I'm using C++11 and up) :-)Like I said, my issue is speed. Date calculations are not a significant part of the program logic, but they take a large fraction of the total execution time, hence my candidate for optimisation...