Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Fixed punctuation and grammar plus minor spelling changes.
  • Loading branch information
zencatalyst authored and eliaskosunen committed Nov 2, 2024
1 parent 4e81ab7 commit 844695d
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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).
Expand All @@ -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
```

Expand Down Expand Up @@ -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 `<iostream>`s.
In a Debug-environment, scnlib is ~5x bigger when compared to `scanf`
or `<iostream>`. After `strip`ing the binaries,
or `<iostream>`. After *stripping* the binaries,
these differences largely go away, except in Debug builds.

#### About
Expand All @@ -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
Expand Down Expand Up @@ -422,21 +422,20 @@ 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.

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.

Expand All @@ -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 `<ranges>` implementation:
*NanoRange* for a minimal `<ranges>` implementation:
https://github.com/tcbrindle/NanoRange

## License
Expand Down

0 comments on commit 844695d

Please sign in to comment.