Skip to content

[WIP] optimize#16

Merged
utkarshkukreti merged 2 commits intomasterfrom
optimize
Jun 29, 2022
Merged

[WIP] optimize#16
utkarshkukreti merged 2 commits intomasterfrom
optimize

Conversation

@utkarshkukreti
Copy link
Owner

See commit messages for benchmarks.

This version allocations a bit more memory up front but is faster in all
benchmarks, sometimes significantly faster.

group                                                 after                  before
-----                                                 -----                  ------
10 equal items                                        1.00   171.8±11.75ns   1.09    187.6±7.73ns
10 non-equal items                                    1.00  1150.8±36.11ns   1.08  1242.8±36.13ns
100 equal items                                       1.00   296.0±10.78ns   1.24   366.0±13.09ns
100 non-equal items                                   1.00     29.2±1.57µs   1.15     33.5±1.38µs
1000 equal items                                      1.00  1354.9±36.02ns   1.50      2.0±0.06µs
1000 non-equal items                                  1.00  1868.1±68.60µs   1.24      2.3±0.07ms
1024 byte string, last 256 different                  1.00    143.9±3.67µs   1.47    212.1±7.86µs
diff::chars on gitignore files from rust-lang/rust    1.00     68.6±1.99ms   1.46    100.5±2.87ms
diff::lines on gitignore files from rust-lang/rust    1.00      5.9±0.15ms   3.69     21.7±0.47ms
empty                                                 1.00    109.1±4.98ns   1.14    124.2±4.88ns
group                                                 after                  before
-----                                                 -----                  ------
10 equal items                                        1.00    113.1±3.09ns   1.50    169.6±5.33ns
10 non-equal items                                    1.00   498.5±19.32ns   2.28  1137.9±43.20ns
100 equal items                                       1.00    257.9±8.30ns   1.14   295.2±11.59ns
100 non-equal items                                   1.00     17.4±0.40µs   1.66     28.8±1.02µs
1000 equal items                                      1.12  1534.4±45.30ns   1.00  1363.9±41.31ns
1000 non-equal items                                  1.08      2.0±0.08ms   1.00  1854.9±64.81µs
1024 byte string, last 256 different                  1.00    101.2±3.13µs   1.43    144.6±4.20µs
diff::chars on gitignore files from rust-lang/rust    1.00     65.9±2.54ms   1.04     68.7±2.67ms
diff::lines on gitignore files from rust-lang/rust    1.00      4.9±0.18ms   1.20      5.9±0.15ms
empty                                                 1.00     58.1±2.91ns   1.85    107.4±3.85ns
@utkarshkukreti
Copy link
Owner Author

Tested this branch against https://github.com/colin-kiegel/rust-pretty-assertions. All their tests pass and their diff benchmarks show a good improvement:

$ cargo bench -- diff
diff different/character
                        time:   [1.9597 us 1.9707 us 1.9821 us]
                        change: [-0.2754% +0.7054% +1.5970%] (p = 0.13 > 0.05)
                        No change in performance detected.
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
diff different/64 char string
                        time:   [18.412 us 18.515 us 18.617 us]
                        change: [-41.523% -41.029% -40.543%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
diff different/64x64 char block
                        time:   [38.833 ms 39.007 ms 39.188 ms]
                        change: [-42.408% -41.902% -41.419%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

@utkarshkukreti utkarshkukreti marked this pull request as ready for review May 10, 2022 03:21
@utkarshkukreti utkarshkukreti merged commit c6fef96 into master Jun 29, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 30, 2022
…crum

update few deps

Updates few crates:

* openssl-src v111.18.0+1.1.1n -> v111.22.0+1.1.1q: fixes few CVE's (https://www.openssl.org/news/vulnerabilities-1.1.1.html: https://cve.org/CVERecord?id=CVE-2022-1292 https://cve.org/CVERecord?id=CVE-2022-2068 https://cve.org/CVERecord?id=CVE-2022-2097)

* openssl-probe v0.1.2 -> v0.1.5 updates ancient (2017) crate (rustls/openssl-probe@0.1.2...0.1.5). Adds support to search cert for additional platforms.

* indoc v1.0.3 -> v1.0.6 (dtolnay/indoc@1.0.3...1.0.6) Nothing special changed, removes unindent v0.1.7

* bstr v0.2.13 -> v0.2.17 (BurntSushi/bstr@0.2.13...0.2.17) Few speedups (BurntSushi/bstr@8e65992, BurntSushi/bstr@5fcef91) and bugfix (BurntSushi/bstr@b2111b6)

* crc32fast v1.2.0 -> v1.3.2 (srijs/rust-crc32fast@v1.2.0...v1.3.2) Speedup debug (srijs/rust-crc32fast@e61ce6a)

* diff v0.1.12 -> v0.1.13 (utkarshkukreti/diff.rs@0.1.12...0.1.13) Few optimizations (utkarshkukreti/diff.rs#16, utkarshkukreti/diff.rs@0f0aa58)

* ignore v0.4.17 -> v0.4.18 (it's hard to get usable diff, but most notable perf change is BurntSushi/ripgrep@a28e664)

* globset v0.4.5 -> v0.4.9

* regex v1.5.5 -> v1.5.6 few bugfixes (https://github.com/rust-lang/regex/blob/1.5.6/CHANGELOG.md#156-2022-05-20). There exist 1.6.0 version, but it's too fresh.
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 20, 2024
update few deps

Updates few crates:

* openssl-src v111.18.0+1.1.1n -> v111.22.0+1.1.1q: fixes few CVE's (https://www.openssl.org/news/vulnerabilities-1.1.1.html: https://cve.org/CVERecord?id=CVE-2022-1292 https://cve.org/CVERecord?id=CVE-2022-2068 https://cve.org/CVERecord?id=CVE-2022-2097)

* openssl-probe v0.1.2 -> v0.1.5 updates ancient (2017) crate (rustls/openssl-probe@0.1.2...0.1.5). Adds support to search cert for additional platforms.

* indoc v1.0.3 -> v1.0.6 (dtolnay/indoc@1.0.3...1.0.6) Nothing special changed, removes unindent v0.1.7

* bstr v0.2.13 -> v0.2.17 (BurntSushi/bstr@0.2.13...0.2.17) Few speedups (BurntSushi/bstr@8e65992, BurntSushi/bstr@5fcef91) and bugfix (BurntSushi/bstr@b2111b6)

* crc32fast v1.2.0 -> v1.3.2 (srijs/rust-crc32fast@v1.2.0...v1.3.2) Speedup debug (srijs/rust-crc32fast@e61ce6a)

* diff v0.1.12 -> v0.1.13 (utkarshkukreti/diff.rs@0.1.12...0.1.13) Few optimizations (utkarshkukreti/diff.rs#16, utkarshkukreti/diff.rs@0f0aa58)

* ignore v0.4.17 -> v0.4.18 (it's hard to get usable diff, but most notable perf change is BurntSushi/ripgrep@a28e664)

* globset v0.4.5 -> v0.4.9

* regex v1.5.5 -> v1.5.6 few bugfixes (https://github.com/rust-lang/regex/blob/1.5.6/CHANGELOG.md#156-2022-05-20). There exist 1.6.0 version, but it's too fresh.
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
update few deps

Updates few crates:

* openssl-src v111.18.0+1.1.1n -> v111.22.0+1.1.1q: fixes few CVE's (https://www.openssl.org/news/vulnerabilities-1.1.1.html: https://cve.org/CVERecord?id=CVE-2022-1292 https://cve.org/CVERecord?id=CVE-2022-2068 https://cve.org/CVERecord?id=CVE-2022-2097)

* openssl-probe v0.1.2 -> v0.1.5 updates ancient (2017) crate (rustls/openssl-probe@0.1.2...0.1.5). Adds support to search cert for additional platforms.

* indoc v1.0.3 -> v1.0.6 (dtolnay/indoc@1.0.3...1.0.6) Nothing special changed, removes unindent v0.1.7

* bstr v0.2.13 -> v0.2.17 (BurntSushi/bstr@0.2.13...0.2.17) Few speedups (BurntSushi/bstr@8e65992, BurntSushi/bstr@5fcef91) and bugfix (BurntSushi/bstr@b2111b6)

* crc32fast v1.2.0 -> v1.3.2 (srijs/rust-crc32fast@v1.2.0...v1.3.2) Speedup debug (srijs/rust-crc32fast@e61ce6a)

* diff v0.1.12 -> v0.1.13 (utkarshkukreti/diff.rs@0.1.12...0.1.13) Few optimizations (utkarshkukreti/diff.rs#16, utkarshkukreti/diff.rs@0f0aa58)

* ignore v0.4.17 -> v0.4.18 (it's hard to get usable diff, but most notable perf change is BurntSushi/ripgrep@a28e664)

* globset v0.4.5 -> v0.4.9

* regex v1.5.5 -> v1.5.6 few bugfixes (https://github.com/rust-lang/regex/blob/1.5.6/CHANGELOG.md#156-2022-05-20). There exist 1.6.0 version, but it's too fresh.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant