Skip to content

Commit

Permalink
More optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
RoDmitry authored and RoDmitry committed Aug 25, 2022
1 parent 99183bb commit 073dcd4
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "atoi_simd"
version = "0.2.0"
version = "0.2.1"
authors = ["Dmitry Rodionov <[email protected]>"]
description = "Rust fast `&str` to integer parser (x86_64 SIMD, SSE4.1, AVX2)"
repository = "https://github.com/RoDmitry/atoi_simd"
Expand Down
48 changes: 43 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,51 @@ You can run `cargo bench` on your machine.

### Results

<details open><summary>v0.2.x</summary>

More information you can find [here](https://rodmitry.github.io/atoi_simd_benchmark).

<details open><summary><b>Rust 1.63</b>, Windows 10, Intel i7 9700K, "target-feature" set</summary>
<details open><summary>v0.2.1+</summary>

<b>Rust 1.63</b>, Windows 10, Intel i7 9700K, "target-feature" set

![all](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.1/report/lines.svg?raw=true)

#### `parse()` u64

![parse() u64](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.1/u64/report/lines.svg?raw=true)

#### `std::parse::<u64>()`

![std::parse::<u64>()](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.1/std%20u64/report/lines.svg?raw=true)

#### `parse_i64()`

![parse_i64()](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.1/i64/report/lines.svg?raw=true)

#### `std::parse::<i64>()`

![std::parse::<i64>()](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.1/std%20i64/report/lines.svg?raw=true)

#### `parse_u128()`

![parse_u128()](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.1/u128/report/lines.svg?raw=true)

#### `std::parse::<u128>()`

![std::parse::<u128>()](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.1/std%20u128/report/lines.svg?raw=true)

#### `parse_i128()`

![parse_i128()](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.1/i128/report/lines.svg?raw=true)

#### `std::parse::<i128>()`

![std::parse::<i128>()](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.1/std%20i128/report/lines.svg?raw=true)

</details>

<details><summary>v0.2.0</summary>

<b>Rust 1.63</b>, Windows 10, Intel i7 9700K, "target-feature" set

![all](https://github.com/rodmitry/atoi_simd_benchmark/blob/v0.2.0/report/lines.svg?raw=true)

Expand Down Expand Up @@ -85,8 +125,6 @@ More information you can find [here](https://rodmitry.github.io/atoi_simd_benchm

</details>

</details>

<details><summary>v0.1.x</summary>

### What was noticed
Expand Down
16 changes: 11 additions & 5 deletions benches/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,20 @@ fn bench_128(bench_group: &mut BenchmarkGroup<WallTime>, str: &str) {
fn benchmark(c: &mut Criterion) {
let mut bench_group = c.benchmark_group("benchmark");
let mut str = String::new();
for i in '1'..='3' {
for i in '1'..='5' {
str.push(i);
bench_64(&mut bench_group, &str);
bench_128(&mut bench_group, &str);
}

str = "12345".to_owned();
bench_64(&mut bench_group, &str);
bench_128(&mut bench_group, &str);
str = "123456".to_owned();
for i in '7'..='9' {
str.push(i);
bench_64(&mut bench_group, &str);
bench_128(&mut bench_group, &str);
}

str = "1234567890".to_owned();
str = "123456789012".to_owned();
bench_64(&mut bench_group, &str);
bench_128(&mut bench_group, &str);

Expand All @@ -92,6 +95,9 @@ fn benchmark(c: &mut Criterion) {
str = "123456789012345678901234567890".to_owned();
bench_128(&mut bench_group, &str);

str = "1234567890123456789012345678901".to_owned();
bench_128(&mut bench_group, &str);

str = "12345678901234567890123456789012".to_owned();
bench_128(&mut bench_group, &str);

Expand Down
Loading

0 comments on commit 073dcd4

Please sign in to comment.