Optimization in Educational
Committing optimization fix for dms::setFromString(), as submitted by Andrew Buck and improved by Luciano Montanaro.
Thanks for the submission, Andrew. I'm having trouble understanding how kstars could be spending so much time in this function. I don't see that it is called by any inner loops. I noticed that you patched against the 3.5.x version of the code (which is why you didn't find QString::stripWhiteSpace() in the Qt docs; that function is called trimmed() in Qt-4.x). But even in that version, I only see the following calls to setFromString():
KStarsData::processCustomDataLine() [used when initializing custom catalogs] KStarsData::executeScript() [used when parsing a KStars DCOP script]
dmsBox::createDms(), which in turn is called by FocusDialog and LocationDialog, in functions that should only be used when those dialogs are opened.
Do your gprof results indicate the calling sequence that led to execution of setFromString() ?
thanks again, and welcome to kstars development! :)