-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative sortByPositionPresorted() and String generation optimization for TheoreticalSpectrumGenerator #89
base: develop
Are you sure you want to change the base?
Conversation
TheoreticalSpectrumGenerator.cpp
We've written a new sort-Function for partially sorted chunks of Peaks in a spectrum. Also MSSpectrum::select() got optimized by applying moves and reserves. |
really nice work! Can you say how much time the String creation saves? Its still a bit inconsistent, because sometimes strings are created even though they will never be used (add_meta == false), or they are created in a loop. So, is String creation still a larger chunk in the flame graph? |
I think, add_metainfo_ is almost always true, so creating the Strings is almost always needed. |
Note: I am currently only testing the SimpleSearchEngine, which doesnt use losses, precursors or abundantImmoniumIons. So, we don't actually test the optimizations in those functions right now. |
Looking at the flamegraph, the biggest difference is, that the String::operator+(String) chunk is basically gone. All other chunks stayed more or less the same. The percentage of addPeaks_ went from 4.5% to 3%. |
in line
the local variables are copied to the spectrum data arrays. |
does this really work:
wrapped in an outer chunk:
?? |
The last commits have sped up getSpectrum() once more. Compared to a build from the develop-Branch, the function is now 40% faster (in the SimpleSearchEngine). |
I changed the configuration of SimpleSearchEngine to test more functions, that we had optimized in above commits. EmpiriclaFormula::toString() appears to be very expensive. So I added a static map<EmpiricalFormula, String> to cache earlier computed formula-Strings. Also EmpiricalFormula::operator<() was optimized by reordering comparisons. That too brought a good speed-up. Depending on the SimpleSearchEngine's settings, the speedup lies between 7% and 20%. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quiet get when you can do chunks.add(true)
and when only chunks.add(false)
. For the rest i made some (little) comments, but looks good
…inters for MetaDataArrays to reduce moving
No description provided.