sob., 11 paź 2025 o 09:30 Matt Borland via Boost <boost@lists.boost.org> napisał(a):
I have a question, is it possible at all that on some platform the "fast" types are slower than the IEEE 754 types?
For basic operations no. The two slowest parts for any operation are decoding the value, and normalization to remove the effects of cohorts. The fast types are a struct that stores the value always normalized, and decoded. The <charconv> operations can be a bit slower for the fast types. from_chars has to go through the normalization steps for the fast types only, and to_chars has to strip off all the trailing zeros that normalization adds. If we assume you do from_chars and to_chars once each per value the extra expense gets amortized quickly into actually performing calculations with the value.
This is a very important information and it belongs in the library docs. I would also request that you describe what happens upon addition, when a new number is being produced: which item from the cohort is chosen? Does that matter for performance? Regards, &rzej;
In the last review someone brought up that there exist hardware platforms in the compile farm that have a decimal floating point units. I have been working on a wrapper around this native type because that should offer the best performance. This wrapper type could (should) exceed the performance of the fast types for those that have that system (POWER10 in my case).
Matt_______________________________________________ Boost mailing list -- boost@lists.boost.org To unsubscribe send an email to boost-leave@lists.boost.org https://lists.boost.org/mailman3/lists/boost.lists.boost.org/ Archived at: https://lists.boost.org/archives/list/boost@lists.boost.org/message/7GQPS4JN...