Skip to content

Commit

Permalink
Merge pull request #189 from Alexhuszagh/docs
Browse files Browse the repository at this point in the history
Update CHANGELOG and README for 1.0.3 and later releases.

This includes updated benchmarks, build sizes, and timings.
  • Loading branch information
Alexhuszagh authored Dec 7, 2024
2 parents edceaca + d797ce8 commit b9612d9
Show file tree
Hide file tree
Showing 56 changed files with 20,057 additions and 15,043 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Improved performance of integer and float formatting using the [jeaiii](https://jk-jeon.github.io/posts/2022/02/jeaiii-algorithm/) algorithm with additional optimizations to minimize branching (#163). This also improves memory safety guarantees, since no unsafe indexing is used when formatting integers.
- Updated our build timings, binary sizes, and benchmarks.

## [1.0.3] 2024-12-06

### Changed

- Improved performance of number formatting with non-decimal radices (#169).

### Fixed

- Inaccurate number formatting with non-decimal radices (#169).

## [1.0.2] 2024-09-24

### Changed
Expand Down
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ High-performance numeric conversion routines for use in a `no_std` environment.

**Similar Projects**

If you want a minimal, stable, and compile-time friendly version of lexical's float-parsing algorithm, see [minimal-lexical](https://github.com/Alexhuszagh/minimal-lexical).

If you want a minimal, performant float parser, recent versions of the Rust standard library should be [sufficient](https://github.com/rust-lang/rust/pull/86761). For high-performance integer formatters, look at [itoa](https://docs.rs/itoa/latest/itoa/). The [metrics](#metrics) section contains a detailed comparison of various crates and their performance in comparison to lexical.
If you want a minimal, performant float parser, recent versions of the Rust standard library should be [sufficient](https://github.com/rust-lang/rust/pull/86761). For high-performance integer formatters, look at [itoa](https://docs.rs/itoa/latest/itoa/). The [metrics](#metrics) section contains a detailed comparison of various crates and their performance in comparison to lexical. Lexical is the currently fastest Rust number formatter and parser, and is tested against:
- [itoa](https://crates.io/crates/itoa)
- [dtoa](https://crates.io/crates/dtoa)
- [ryu](https://crates.io/crates/ryu)
- Rust core library

**Table of Contents**

Expand Down Expand Up @@ -288,69 +290,69 @@ The binary sizes of stripped binaries compiled at optimization level "2". For a

A benchmark on randomly-generated integers uniformly distributed over the entire range.

![Uniform Random Data](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/json_random%20-%20parse%20int%20-%20core,lexical.png)
![Uniform Random Data](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/json_random%20-%20parse%20int%20-%20core,lexical.png)

**Simple**

A benchmark on randomly-generated integers from 1-1000.

![Simple Random Data](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/json_simple%20-%20parse%20int%20-%20core,lexical.png)
![Simple Random Data](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/json_simple%20-%20parse%20int%20-%20core,lexical.png)

### Benchmarks — Parse Float

**Real-World Datasets**

A benchmark on parsing floats from various real-world data sets, including Canada, Mesh, and astronomical data (earth).

![Canada](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/canada%20-%20parse%20float%20-%20core,lexical.png)
![Canada](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/canada%20-%20parse%20float%20-%20core,lexical.png)

![Earth](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/earth%20-%20parse%20float%20-%20core,lexical.png)
![Earth](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/earth%20-%20parse%20float%20-%20core,lexical.png)

![Mesh](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/mesh%20-%20parse%20float%20-%20core,lexical.png)
![Mesh](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/mesh%20-%20parse%20float%20-%20core,lexical.png)

**Random**

A benchmark on randomly-generated integers uniformly distributed over the entire range.

![Random Big Integer](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/random_big_ints%20-%20parse%20float%20-%20core,lexical.png)
![Random Big Integer](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/random_big_ints%20-%20parse%20float%20-%20core,lexical.png)

**Simple**

A benchmark on randomly-generated integers from 1-1000.

![Random Simple](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/random_simple_int64%20-%20parse%20float%20-%20core,lexical.png)
![Random Simple](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/random_simple_int64%20-%20parse%20float%20-%20core,lexical.png)

### Benchmarks — Write Integer

**Random**

A benchmark on randomly-generated integers uniformly distributed over the entire range.

![Random Uniform](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/json_chain_random%20-%20write%20int%20-%20fmt,itoa,lexical.png)
![Random Uniform](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/json_chain_random%20-%20write%20int%20-%20fmt,itoa,lexical.png)

**Simple**

![Random Simple](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/json_simple%20-%20write%20int%20-%20fmt,itoa,lexical.png)
![Random Simple](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/json_simple%20-%20write%20int%20-%20fmt,itoa,lexical.png)

**Large**

![Random Large](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/random_large%20-%20write%20int%20-%20fmt,itoa,lexical.png)
![Random Large](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/random_large%20-%20write%20int%20-%20fmt,itoa,lexical.png)

### Benchmarks — Write Float

**Big Integer**

A benchmarks for values with a large integers.

![Big Integers](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/random_big_ints%20-%20write%20float%20-%20dtoa,fmt,lexical,ryu.png)
![Big Integers](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/random_big_ints%20-%20write%20float%20-%20dtoa,fmt,lexical,ryu.png)

**Simple 64-Bit Inteers**

![Simple Int64](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/random_simple_int64%20-%20write%20float%20-%20dtoa,fmt,lexical,ryu.png)
![Simple Int64](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/random_simple_int64%20-%20write%20float%20-%20dtoa,fmt,lexical,ryu.png)

**Random**

![Random](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/da4728e/plot/json%20-%20write%20float%20-%20dtoa,fmt,lexical,ryu.png)
![Random](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/edceaca/plot/json%20-%20write%20float%20-%20dtoa,fmt,lexical,ryu.png)

## Safety

Expand Down
2 changes: 1 addition & 1 deletion assets/size0_nt.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"core": {"pe": {"parse-float-f32": 38288, "parse-float-f64": 39008, "parse-integer-i128": 6736, "parse-integer-i16": 5808, "parse-integer-i32": 5728, "parse-integer-i64": 5920, "parse-integer-i8": 5744, "parse-integer-u128": 6528, "parse-integer-u16": 5824, "parse-integer-u32": 5728, "parse-integer-u64": 5920, "parse-integer-u8": 5728, "write-float-f32": 39368, "write-float-f64": 39464, "write-integer-i128": 16016, "write-integer-i16": 14816, "write-integer-i32": 14472, "write-integer-i64": 14800, "write-integer-i8": 14800, "write-integer-u128": 16000, "write-integer-u16": 14784, "write-integer-u32": 14368, "write-integer-u64": 14472, "write-integer-u8": 14456}}, "lexical": {"pe": {"parse-float-f32": 104976, "parse-float-f64": 105416, "parse-integer-i128": 27328, "parse-integer-i16": 25152, "parse-integer-i32": 24848, "parse-integer-i64": 25200, "parse-integer-i8": 24864, "parse-integer-u128": 27088, "parse-integer-u16": 24976, "parse-integer-u32": 24592, "parse-integer-u64": 25000, "parse-integer-u8": 24704, "write-float-f32": 63424, "write-float-f64": 82416, "write-integer-i128": 25592, "write-integer-i16": 16280, "write-integer-i32": 16224, "write-integer-i64": 17168, "write-integer-i8": 16248, "write-integer-u128": 24128, "write-integer-u16": 15200, "write-integer-u32": 15144, "write-integer-u64": 16024, "write-integer-u8": 15168}}}
{"core": {"pe": {"parse-float-f32": 18224, "parse-float-f64": 18464, "parse-integer-i128": 5496, "parse-integer-i16": 4720, "parse-integer-i32": 4688, "parse-integer-i64": 4704, "parse-integer-i8": 4512, "parse-integer-u128": 5328, "parse-integer-u16": 4720, "parse-integer-u32": 4640, "parse-integer-u64": 4704, "parse-integer-u8": 4624, "write-float-f32": 37480, "write-float-f64": 37544, "write-integer-i128": 16688, "write-integer-i16": 15800, "write-integer-i32": 15240, "write-integer-i64": 15896, "write-integer-i8": 15512, "write-integer-u128": 16672, "write-integer-u16": 15544, "write-integer-u32": 15240, "write-integer-u64": 15256, "write-integer-u8": 15240}}, "lexical": {"pe": {"parse-float-f32": 167816, "parse-float-f64": 168320, "parse-integer-i128": 31832, "parse-integer-i16": 16536, "parse-integer-i32": 28040, "parse-integer-i64": 30056, "parse-integer-i8": 16408, "parse-integer-u128": 31112, "parse-integer-u16": 15976, "parse-integer-u32": 27432, "parse-integer-u64": 29496, "parse-integer-u8": 15832, "write-float-f32": 97864, "write-float-f64": 154064, "write-integer-i128": 210816, "write-integer-i16": 12928, "write-integer-i32": 27880, "write-integer-i64": 57392, "write-integer-i8": 7232, "write-integer-u128": 107776, "write-integer-u16": 8032, "write-integer-u32": 15568, "write-integer-u64": 30480, "write-integer-u8": 5008}}}
2 changes: 1 addition & 1 deletion assets/size0_posix.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"core": {"unstripped": {"parse-integer-u8": 5072, "write-integer-u16": 13771, "write-integer-i8": 13739, "write-integer-u128": 14999, "write-integer-i32": 13467, "parse-float-f32": 24412, "write-integer-i16": 13771, "write-integer-u32": 13371, "parse-integer-i128": 6064, "write-integer-i64": 13755, "parse-integer-i64": 5232, "write-integer-u64": 13451, "parse-float-f64": 24780, "parse-integer-u32": 5024, "parse-integer-u64": 5232, "write-float-f32": 36319, "parse-integer-u128": 5920, "write-float-f64": 36415, "parse-integer-i16": 5152, "parse-integer-u16": 5152, "write-integer-u8": 13419, "parse-integer-i32": 5024, "write-integer-i128": 15015, "parse-integer-i8": 5072}, "stripped": {"parse-integer-u8": 5072, "write-integer-u16": 13771, "write-integer-i8": 13739, "write-integer-u128": 14999, "write-integer-i32": 13467, "parse-float-f32": 24412, "write-integer-i16": 13771, "write-integer-u32": 13371, "parse-integer-i128": 6064, "write-integer-i64": 13755, "parse-integer-i64": 5232, "write-integer-u64": 13451, "parse-float-f64": 24780, "parse-integer-u32": 5024, "parse-integer-u64": 5232, "write-float-f32": 36319, "parse-integer-u128": 5920, "write-float-f64": 36415, "parse-integer-i16": 5152, "parse-integer-u16": 5152, "write-integer-u8": 13419, "parse-integer-i32": 5024, "write-integer-i128": 15015, "parse-integer-i8": 5072}}, "lexical": {"unstripped": {"write-integer-u128": 21392, "write-integer-i16": 14256, "write-float-f64": 75536, "write-integer-u8": 13280, "write-float-f32": 56976, "write-integer-u32": 13264, "parse-integer-u8": 22272, "parse-integer-i8": 22400, "write-integer-i32": 14208, "parse-integer-i64": 22672, "parse-integer-u16": 22528, "parse-float-f32": 94448, "write-integer-u64": 13936, "parse-integer-i32": 22384, "parse-integer-u128": 24544, "write-integer-u16": 13312, "parse-integer-i16": 22656, "parse-integer-u32": 22176, "write-integer-i64": 14928, "write-integer-i8": 14224, "parse-integer-i128": 24752, "parse-integer-u64": 22528, "write-integer-i128": 22688, "parse-float-f64": 94992}, "stripped": {"write-integer-u128": 21392, "write-integer-i16": 14256, "write-float-f64": 75536, "write-integer-u8": 13280, "write-float-f32": 56976, "write-integer-u32": 13264, "parse-integer-u8": 22272, "parse-integer-i8": 22400, "write-integer-i32": 14208, "parse-integer-i64": 22672, "parse-integer-u16": 22528, "parse-float-f32": 94448, "write-integer-u64": 13936, "parse-integer-i32": 22384, "parse-integer-u128": 24544, "write-integer-u16": 13312, "parse-integer-i16": 22656, "parse-integer-u32": 22176, "write-integer-i64": 14928, "write-integer-i8": 14224, "parse-integer-i128": 24752, "parse-integer-u64": 22528, "write-integer-i128": 22688, "parse-float-f64": 94992}}}
{"core": {"unstripped": {"parse-float-f32": 18032, "parse-float-f64": 18288, "parse-integer-i128": 5624, "parse-integer-i16": 4560, "parse-integer-i32": 4456, "parse-integer-i64": 4512, "parse-integer-i8": 4480, "parse-integer-u128": 5480, "parse-integer-u16": 4552, "parse-integer-u32": 4448, "parse-integer-u64": 4504, "parse-integer-u8": 4464, "write-float-f32": 25012, "write-float-f64": 25044, "write-integer-i128": 5852, "write-integer-i16": 4880, "write-integer-i32": 4416, "write-integer-i64": 5032, "write-integer-i8": 4656, "write-integer-u128": 5828, "write-integer-u16": 4656, "write-integer-u32": 4424, "write-integer-u64": 4432, "write-integer-u8": 4424}, "stripped": {"parse-float-f32": 18032, "parse-float-f64": 18288, "parse-integer-i128": 5624, "parse-integer-i16": 4560, "parse-integer-i32": 4456, "parse-integer-i64": 4512, "parse-integer-i8": 4480, "parse-integer-u128": 5480, "parse-integer-u16": 4552, "parse-integer-u32": 4448, "parse-integer-u64": 4504, "parse-integer-u8": 4464, "write-float-f32": 25012, "write-float-f64": 25044, "write-integer-i128": 5852, "write-integer-i16": 4880, "write-integer-i32": 4416, "write-integer-i64": 5032, "write-integer-i8": 4656, "write-integer-u128": 5828, "write-integer-u16": 4656, "write-integer-u32": 4424, "write-integer-u64": 4432, "write-integer-u8": 4424}}, "lexical": {"unstripped": {"parse-float-f32": 170588, "parse-float-f64": 171084, "parse-integer-i128": 31804, "parse-integer-i16": 15972, "parse-integer-i32": 27036, "parse-integer-i64": 29076, "parse-integer-i8": 15884, "parse-integer-u128": 31100, "parse-integer-u16": 15356, "parse-integer-u32": 26444, "parse-integer-u64": 28468, "parse-integer-u8": 15268, "write-float-f32": 95940, "write-float-f64": 154116, "write-integer-i128": 217736, "write-integer-i16": 12364, "write-integer-i32": 28004, "write-integer-i64": 58796, "write-integer-i8": 6428, "write-integer-u128": 110472, "write-integer-u16": 7340, "write-integer-u32": 15124, "write-integer-u64": 30572, "write-integer-u8": 4244}, "stripped": {"parse-float-f32": 170588, "parse-float-f64": 171084, "parse-integer-i128": 31804, "parse-integer-i16": 15972, "parse-integer-i32": 27036, "parse-integer-i64": 29076, "parse-integer-i8": 15884, "parse-integer-u128": 31100, "parse-integer-u16": 15356, "parse-integer-u32": 26444, "parse-integer-u64": 28468, "parse-integer-u8": 15268, "write-float-f32": 95940, "write-float-f64": 154116, "write-integer-i128": 217736, "write-integer-i16": 12364, "write-integer-i32": 28004, "write-integer-i64": 58796, "write-integer-i8": 6428, "write-integer-u128": 110472, "write-integer-u16": 7340, "write-integer-u32": 15124, "write-integer-u64": 30572, "write-integer-u8": 4244}}}
2 changes: 1 addition & 1 deletion assets/size1_nt.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"core": {"pe": {"parse-float-f32": 25504, "parse-float-f64": 25496, "parse-integer-i128": 2784, "parse-integer-i16": 2336, "parse-integer-i32": 2320, "parse-integer-i64": 2328, "parse-integer-i8": 2320, "parse-integer-u128": 2544, "parse-integer-u16": 2336, "parse-integer-u32": 2320, "parse-integer-u64": 2328, "parse-integer-u8": 2328, "write-float-f32": 31392, "write-float-f64": 31488, "write-integer-i128": 8112, "write-integer-i16": 6960, "write-integer-i32": 6624, "write-integer-i64": 6944, "write-integer-i8": 6976, "write-integer-u128": 8096, "write-integer-u16": 6928, "write-integer-u32": 6624, "write-integer-u64": 6624, "write-integer-u8": 6640}}, "lexical": {"pe": {"parse-float-f32": 46944, "parse-float-f64": 47248, "parse-integer-i128": 6616, "parse-integer-i16": 5136, "parse-integer-i32": 5088, "parse-integer-i64": 5136, "parse-integer-i8": 5128, "parse-integer-u128": 6296, "parse-integer-u16": 4888, "parse-integer-u32": 5552, "parse-integer-u64": 5744, "parse-integer-u8": 4872, "write-float-f32": 20504, "write-float-f64": 33272, "write-integer-i128": 8888, "write-integer-i16": 6400, "write-integer-i32": 6368, "write-integer-i64": 6408, "write-integer-i8": 6416, "write-integer-u128": 8408, "write-integer-u16": 5968, "write-integer-u32": 5952, "write-integer-u64": 6104, "write-integer-u8": 5984}}}
{"core": {"pe": {"parse-float-f32": 17992, "parse-float-f64": 18296, "parse-integer-i128": 1504, "parse-integer-i16": 1304, "parse-integer-i32": 1272, "parse-integer-i64": 1272, "parse-integer-i8": 1256, "parse-integer-u128": 1216, "parse-integer-u16": 632, "parse-integer-u32": 632, "parse-integer-u64": 1128, "parse-integer-u8": 632, "write-float-f32": 25808, "write-float-f64": 25872, "write-integer-i128": 5096, "write-integer-i16": 4248, "write-integer-i32": 3720, "write-integer-i64": 4344, "write-integer-i8": 3976, "write-integer-u128": 5080, "write-integer-u16": 3992, "write-integer-u32": 3720, "write-integer-u64": 3720, "write-integer-u8": 3720}}, "lexical": {"pe": {"parse-float-f32": 36784, "parse-float-f64": 37088, "parse-integer-i128": 4696, "parse-integer-i16": 4248, "parse-integer-i32": 4280, "parse-integer-i64": 4136, "parse-integer-i8": 4248, "parse-integer-u128": 4008, "parse-integer-u16": 3752, "parse-integer-u32": 3592, "parse-integer-u64": 3640, "parse-integer-u8": 3736, "write-float-f32": 14856, "write-float-f64": 38408, "write-integer-i128": 14840, "write-integer-i16": 480, "write-integer-i32": 624, "write-integer-i64": 5152, "write-integer-i8": 416, "write-integer-u128": 8120, "write-integer-u16": 432, "write-integer-u32": 480, "write-integer-u64": 3264, "write-integer-u8": 400}}}
Loading

0 comments on commit b9612d9

Please sign in to comment.