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
Investigate replacing double_conversion library with fast_float #2772
Investigate replacing double_conversion library with fast_float #2772
Conversation
3dd9123
to
9e41db1
Compare
9e41db1
to
e1d5f9f
Compare
e1d5f9f
to
d1ebe50
Compare
16c8fe0
to
07b0cb9
Compare
32a2d64
to
4d7604d
Compare
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.
Thanks for following up on this!
|
||
namespace WTF { | ||
|
||
WTF_EXPORT_PRIVATE double parseDouble(const LChar* string, size_t length, size_t& parsedLength); |
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 I think the way I would structured things would be to rename this file to ParseDouble.h and add all the ParseDouble header bits from dtoa.h here.
I would then name the file you have called FastFloat.cpp to ParseDoubleFastFloat.cpp.
And then, probably in a different change, rename dtoa.h to NumberToString.h and dtoa.cpp to NumberToStringDoubleConversion.cpp
|
||
#include <wtf/fast_float/float_common.h> | ||
|
||
namespace fast_float { |
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.
For whatever reason, we wrapped all the double_conversion namespaces in an our namespace WTF
. Not sure it makes a difference given this is all only included in one cpp file, but maybe for mangling reasons it would be a good idea?
Another good follow up to this would be removing the now unneeded parsing code from our copy of double_conversion. |
4d7604d
to
498737e
Compare
EWS run on previous version of this PR (hash 4d7604d)
|
498737e
to
b5e041d
Compare
EWS run on previous version of this PR (hash b5e041d)
|
ios-wk2 failures are flakiness ones. |
b5e041d
to
900ddd2
Compare
EWS run on current version of this PR (hash 900ddd2)
|
https://bugs.webkit.org/show_bug.cgi?id=221178 Reviewed by Sam Weinig. Parsing double numbers becomes 2x faster. ToT Patched json-parse-double 230.0022+-0.0838 ^ 111.1297+-0.0983 ^ definitely 2.0697x faster Apple OSS approval for fast_float is OSS-4890. * Source/WTF/WTF.xcodeproj/project.pbxproj: * Source/WTF/wtf/CMakeLists.txt: * Source/WTF/wtf/FastFloat.cpp: Added. (WTF::parseDouble): * Source/WTF/wtf/FastFloat.h: Added. * Source/WTF/wtf/dtoa.h: * Source/WTF/wtf/fast_float/LICENSE: Added. * Source/WTF/wtf/fast_float/ascii_number.h: Added. (fast_float::byteswap): (fast_float::read_u64): (fast_float::write_u64): (fast_float::parse_eight_digits_unrolled): * Source/WTF/wtf/fast_float/bigint.h: Added. (fast_float::stackvec::stackvec): (fast_float::bigint::bigint): * Source/WTF/wtf/fast_float/decimal_to_binary.h: Added. (fast_float::compute_product_approximation): * Source/WTF/wtf/fast_float/digit_comparison.h: Added. * Source/WTF/wtf/fast_float/fast_float.h: Added. (fast_float::parse_options::parse_options): * Source/WTF/wtf/fast_float/fast_table.h: Added. * Source/WTF/wtf/fast_float/float_common.h: Added. (fast_float::fastfloat_strncasecmp): (fast_float::span::span): (fast_float::value128::value128): (fast_float::leading_zeroes): (fast_float::emulu): (fast_float::_umul128): (fast_float::full_multiplication): (fast_float::adjusted_mantissa::operator== const): (fast_float::adjusted_mantissa::operator!= const): (fast_float::binary_format<double>::mantissa_explicit_bits): (fast_float::binary_format<float>::mantissa_explicit_bits): (fast_float::binary_format<double>::max_exponent_round_to_even): (fast_float::binary_format<float>::max_exponent_round_to_even): (fast_float::binary_format<double>::min_exponent_round_to_even): (fast_float::binary_format<float>::min_exponent_round_to_even): (fast_float::binary_format<double>::minimum_exponent): (fast_float::binary_format<float>::minimum_exponent): (fast_float::binary_format<double>::infinite_power): (fast_float::binary_format<float>::infinite_power): (fast_float::binary_format<double>::sign_index): (fast_float::binary_format<float>::sign_index): (fast_float::binary_format<double>::min_exponent_fast_path): (fast_float::binary_format<float>::min_exponent_fast_path): (fast_float::binary_format<double>::max_exponent_fast_path): (fast_float::binary_format<float>::max_exponent_fast_path): (fast_float::binary_format<double>::max_mantissa_fast_path): (fast_float::binary_format<float>::max_mantissa_fast_path): (fast_float::binary_format<double>::exact_power_of_ten): (fast_float::binary_format<float>::exact_power_of_ten): (fast_float::binary_format<double>::largest_power_of_ten): (fast_float::binary_format<float>::largest_power_of_ten): (fast_float::binary_format<double>::smallest_power_of_ten): (fast_float::binary_format<float>::smallest_power_of_ten): (fast_float::binary_format<double>::max_digits): (fast_float::binary_format<float>::max_digits): (fast_float::binary_format<float>::exponent_mask): (fast_float::binary_format<double>::exponent_mask): (fast_float::binary_format<float>::mantissa_mask): (fast_float::binary_format<double>::mantissa_mask): (fast_float::binary_format<float>::hidden_bit_mask): (fast_float::binary_format<double>::hidden_bit_mask): (fast_float::to_float): * Source/WTF/wtf/fast_float/parse_number.h: Added. * Source/WTF/wtf/fast_float/simple_decimal_conversion.h: Added. (fast_float::detail::trim): (fast_float::detail::number_of_digits_decimal_left_shift): (fast_float::detail::round): (fast_float::detail::decimal_left_shift): (fast_float::detail::decimal_right_shift): (fast_float::compute_float): (fast_float::parse_long_mantissa): Canonical link: https://commits.webkit.org/257675@main
900ddd2
to
178e072
Compare
Committed 257675@main (178e072): https://commits.webkit.org/257675@main Reviewed commits have been landed. Closing PR #2772 and removing active labels. |
178e072
900ddd2