fast_float

Fast and exact implementation of the C++ from_chars functions for number types: 4x to 10x faster than strtod, part of GCC 12 and WebKit/Safari (by fastfloat)

Fast_float Alternatives

Similar projects and alternatives to fast_float

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better fast_float alternative or higher similarity.

fast_float reviews and mentions

Posts with mentions or reviews of fast_float. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-04-03.
  • Parquet: More than just “Turbo CSV”
    7 projects | news.ycombinator.com | 3 Apr 2023
    > Google put in significant engineering effort into "Ryu", a parsing library for double-precision floating point numbers: https://github.com/ulfjack/ryu

    It's not a parsing library, but a printing one, i.e., double -> string. https://github.com/fastfloat/fast_float is a parsing library, i.e., string -> double, not by Google though, but was indeed motivated by parsing JSON fast https://lemire.me/blog/2020/03/10/fast-float-parsing-in-prac...

  • What do number conversions (from string) cost?
    1 project | /r/cpp | 20 Mar 2023
    For those that don't know, gcc 12.x updated its float parsing logic to something similar to fast_float and it's about 1/6 of the cost presented here (sub 100 in the graph presented here). Strongly suggest using that library or upgrading the compiler if you need the performance.
  • Can sanitizers find the two bugs I wrote in C++?
    11 projects | news.ycombinator.com | 8 Feb 2023
    This makes sense for integers but betware floating point from_chars - libc++ still doesn't implement it and libstdc++ implements it by wrapping locale-dependent libc functions which involves temporarily changing the thread locale and possibly memory allocation to make the passed string 0-terminated. IMO libstdc++'s checkbox "solution" is worse than not implementing it at all - user's are better off using Lemire's API-compatible fast_float implementation [0].

    [0] https://github.com/fastfloat/fast_float

  • Passing Programs To A Stack Machine
    1 project | /r/cpp_questions | 11 Nov 2021
    I'm a bit stuck on how to do the same thing in c++, due to containers only having a single type. The very inefficient way I'm currently doing it is by passing a program as a vector of strings, and then converting the string constants to doubles with the fast_float library.
  • Parsing can become accidentally quadratic because of sscanf
    2 projects | /r/programming | 3 Oct 2021
    Just above this comment is a merged PR, which references fast_float library: https://github.com/fastfloat/fast_float
  • Making Rust Float Parsing Fast: libcore Edition
    10 projects | /r/rust | 17 Jul 2021
    Daniel Lemire @lemire (creator of the algorithm, author of the C++ implementation, and provided constant feedback to help guide the PR).
  • RapidObj v0.1 - A fast, header-only, C++17 library for parsing Wavefront .obj files.
    4 projects | /r/cpp | 28 Jun 2021
    And out of 6,000 lines in the file, at least 3000 are other people's code: earcut for polygon triangulation and fast_float because .obj files typically contain a lot of floating point numbers so it's important to parse them quickly.
  • First release of dragonbox, a fast float-to-string conversion algorithm, is available
    3 projects | /r/cpp | 22 May 2021
    How this compares to https://github.com/fastfloat/fast_float ?
  • Why is std::from_chars<float> slow?
    1 project | /r/cpp | 11 May 2021
    I tried to compare it against Daniel Lemire's excellent fast_float library. Fast float took about 180ms for the same program, and all I did was change "std" namespace prefix to "fast_float". It's a factor of 12 difference, at least my machine. I tried MSVC next, and it is a lot better, but it is still ~4 times slower than fast float. AFAIK, clang currently does not implement the feature at all.
  • Iterator invalidation of std::string_view
    1 project | /r/cpp | 12 Feb 2021
    If you don't mind a 3rd party lib until your stdlib updates, https://github.com/fastfloat/fast_float is best-in-class.
  • A note from our sponsor - WorkOS
    workos.com | 24 Apr 2024
    The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more →

Stats

Basic fast_float repo stats
15
1,269
8.7
about 1 month ago

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com