Repository navigation
[FEATURE] faster number conversion to String using Boost::Karma - #3969
Conversation
|
looks great, that should be a real improvement! Can you look at these failed tests: https://travis-ci.org/OpenMS/OpenMS/jobs/492738641 |
|
fun fact: |
|
more fun facts: |
…ams like the plague actually helps a lot).
|
ok, this is ready for merge. |
|
I am a bit afraid of hitting the merge button ;) ... |
- fix bug introduced in OpenMS#3969 which changes meaning of AASequence strings
- fix bug introduced in OpenMS#3969 which changes meaning of AASequence strings
solves #3962
here are some additional benchmarks for writing larger idXML and featureXML files:
IDFileConverter on 320 MB IdXML file
Win:
old: 20.89 s
new: 12.59 s (-40%, 6% size increase)
Linux:
old: 14.21 s
new: 10.63 s (-26%, 6% size increase)
FileConverter on 192 MB FeatureXML file
Win:
old: 31.16 s
new: 25.78 s (-18%, 3.5% size increase)
Linux:
old: 27.96 s
new: 25.85 s (-8%, 3.5% size increase)
The increase in featureXML is simply not that large because I did not look at the writer code (i.e. using the new String conversion instead of default
... << double << ...). All benefits are implicit.Windows benefits the most, since the stream operators were very inefficient. Its not that bad with GCC, but the speed still increases.
Edit: FuzzyDiff runs about 3x faster (Release build) now as well, after switching to Boost::Qi instead of
stringstream::operator >>(which was required since we hit an AppleClang compiler bug which makes clang interpret5e6as 5 and then stop reading from the stream; this was not a problem before since all our output looked like this. Now with Boost::Karma we write5.0e6which clang reads in full; Boost::Qi just reads both input formats just fine).After this PR is merged, it is advised to maximize writing speed when outputting files like this:
os << String(int/float/double) << ...instead of just the sloweros << int/float/double << ....This will give you full precision by default for float and doubles. If you only need up to three fractional digits use
String(my_number, false), i.e.full_precision = false.