diff --git a/README.md b/README.md index 5e006d62..379893e9 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ Try out in [Compiler Explorer](https://godbolt.org/z/djzKx6Evz). ## What is this? `scnlib` is a modern C++ library for replacing `scanf` and `std::istream`. -This library attempts to move use ever so much closer to replacing `iostream`s -and C stdio altogether. +This library attempts to move us ever so much closer to replacing `iostream`s +and C `stdio` altogether. It's faster than `iostream` (see Benchmarks), and type-safe, unlike `scanf`. Think [{fmt}](https://github.com/fmtlib/fmt) or C++20 `std::format`, but in the other direction. @@ -44,7 +44,7 @@ This library is the reference implementation of the ISO C++ standards proposal ## Documentation -The documentation can be found online, from https://scnlib.dev. +The documentation can be found online, at https://scnlib.dev. To build the docs yourself, build the `scn_docs` target generated by CMake. These targets are generated only if the variable `SCN_DOCS` is set in CMake @@ -180,7 +180,7 @@ See docs for usage without CMake. ## Compiler support -A C++17 compatible compiler is required. The following compilers are tested in +A C++17-compatible compiler is required. The following compilers are tested in CI: * GCC 7 and newer @@ -196,7 +196,7 @@ Including the following environments: * clang-cl with VS 2019 and 2022 * MinGW and MSys2 * GCC on armv6, armv7, aarch64, riscv64, s390x, and ppc64le -* Visual Studio 2022, cross compiling to arm64 +* Visual Studio 2022, cross-compiling to arm64 ## Benchmarks @@ -283,7 +283,7 @@ are really expensive (~400ns of runtime). With `scn::scan` and `std::from_chars`, there's really no state to construct, and the results for "Test 1" and "Test 2" are thus quite similar. -These benchmarks were run on a Fedora 40 machine, running Linux kernel version +These benchmarks were run on a Fedora 40 machine, running the Linux kernel version 6.8.9, with an AMD Ryzen 7 5700X processor, and compiled with clang version 18.1.1, with `-O3 -DNDEBUG -march=haswell` and LTO enabled. These benchmarks were run on 2024-05-23 (commit 3fd830de). @@ -300,7 +300,7 @@ $ cmake -DSCN_BENCHMARKS=ON \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \ -DSCN_USE_HASWELL_ARCH=ON .. $ cmake --build . -# choose benchamrks to run in ./benchmark/runtime/*/*_bench +# choose benchmarks to run in ./benchmark/runtime/*/*_bench $ ./benchmark/runtime/integer/scn_int_bench ``` @@ -355,7 +355,7 @@ When using optimized builds, depending on compiler flags, scnlib provides a binary, the size of which is within ~5% of what would be produced with `scanf` or ``s. In a Debug-environment, scnlib is ~5x bigger when compared to `scanf` -or ``. After `strip`ing the binaries, +or ``. After *stripping* the binaries, these differences largely go away, except in Debug builds. #### About @@ -366,7 +366,7 @@ This is done to simulate a small project. `scnlib` is linked dynamically, to level the playing field with the standard library, which is also dynamically linked. -The code was compiled on Fedora 40, with gcc 14.1.1. +The code was compiled on Fedora 40, with GCC 14.1.1. See the directory `benchmark/binarysize` for the source code. You can run these benchmarks yourself by enabling the CMake @@ -422,13 +422,12 @@ Release builds seem to be slightly faster as compared to Debug builds. #### About -This tests measures the time it takes to compile a binary, when using different +These tests measure the time it takes to compile a binary when using different libraries. -The time taken to compile the library itself is not taken into account (the -standard library is precompiled, anyway). +The time taken to compile the library itself is not taken into account (the standard library is precompiled, anyway). These tests were run on a Fedora 40 machine, with an AMD Ryzen 7 5700X -processor, using gcc version 14.1.1. +processor, using GCC version 14.1.1. The compiler flags used for a Debug build were `-g`, and `-O3 -DNDEBUG` for a Release build. @@ -436,7 +435,7 @@ You can run these benchmarks yourself by enabling the CMake variable `SCN_BENCHMARKS_BUILDTIME`. This variable is `ON` by default, if `scnlib` is the root CMake project, and `OFF` otherwise. -In order for these tests to work, `c++` must point to a gcc-compatible C++ +For these tests to work, `c++` must point to a GCC-compatible C++ compiler binary, and a somewhat POSIX-compatible `/usr/bin/time` must be available. @@ -458,10 +457,10 @@ https://github.com/r1chardj0n3s/parse ### Third-party libraries -fast_float for floating-point number parsing: +*fast_float* for floating-point number parsing: https://github.com/fastfloat/fast_float -NanoRange for a minimal `` implementation: +*NanoRange* for a minimal `` implementation: https://github.com/tcbrindle/NanoRange ## License