views:

43

answers:

1

After profiling some code I've found boost::gregorian::from_simple_string to be inefficient in loops with many iterations. Instruction read counts from using this function seem to be inordinately high. I've tried the locale/facets + stringstream method discussed in this thread but followup profiling didn't show any noticeable improvement.

Has anyone else faced this when needing to create Boost::Date out of strings?

+1  A: 

Boost libraries are NOT designed with performance in mind. Their main goal is well designed interfaces and functionality - not necessarily speed.

You are correct Boost.DateTime and even Boost.Filesystem are very slow for certain string related processing tasks.

That is mainly due to the fact that they are based upon the Boost.Strings and Boost.Tokenizer libraries.

My suggestion is that if you find these routines to be too slow for your needs to roll-out your own implementation of the specific routine.

dman
Thanks dman, looks like I may need to go back to using ctime
ZiKat