I'm working on a program that aims to backtest quantitative strategy and after looking at the performances of the code, I see that more that half of execution time in spent in a very simple function, which now want to optimise.
This function tells me if a stock is trading on a certain date and for that I have all my trading dates saved in a std::vector, thus the function just checks if it finds the date:
I wondered if I could do better using another container. I know unordered_map's complexity for find in constant whereas log(N) for vector. But that would mean putting my date (boost::gregorian::date) as the key value but what would I use as mapped value.