Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unrolled loop for searching NULL in [u16] on Windows #67705

Merged
merged 2 commits into from Apr 9, 2020

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Dec 29, 2019

No description provided.

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 29, 2019
@tesuji tesuji force-pushed the wmemchr branch 2 times, most recently from a61835f to a963e37 Compare December 29, 2019 15:47
@tesuji tesuji changed the title [WIP] add raw wmemchr implementation for Windows Use wmemchr for searching NULL in [u16] on Windows Dec 29, 2019
@tesuji
Copy link
Contributor Author

tesuji commented Dec 29, 2019

r? @BurntSushi

@retep998
Copy link
Member

Can you provide performance comparisons on both pc-windows-msvc and pc-windows-gnu compared to the naive Rust version?

@tesuji
Copy link
Contributor Author

tesuji commented Dec 30, 2019

I don't have windows machine so I cannot bench this.
But there is a report from https://bugzilla.mozilla.org/show_bug.cgi?id=1003726#c5

@tesuji
Copy link
Contributor Author

tesuji commented Dec 30, 2019

Hm. After that they used the unrolled version: https://bugzilla.mozilla.org/show_bug.cgi?id=1033959

@tesuji
Copy link
Contributor Author

tesuji commented Jan 2, 2020

Should I port the unrolled version here or keep this change?

@tesuji
Copy link
Contributor Author

tesuji commented Jan 9, 2020

Hi. Could any Windows devs help benchmarking to push this forward?

@jonas-schievink jonas-schievink added O-windows Operating system: Windows T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jan 18, 2020
@Mark-Simulacrum
Copy link
Member

I'm going to nominate this for compiler team to see if we can get a windows dev to benchmark this.

Personally I'm not sure what are policy in general should be on patches like this, I'm tempted to just close (especially as no one has specifically requested this change in an issue).

@Mark-Simulacrum Mark-Simulacrum added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 19, 2020
@wesleywiser
Copy link
Member

I have a Windows box I can test on. What do I need to do to run the benchmark?

@spastorino
Copy link
Member

As per last triaging meeting discussion, assigning this one to Wesley.

r? @wesleywiser

@spastorino
Copy link
Member

spastorino commented Mar 11, 2020

Removing nomination since this was already discussed in last triage meeting.

@tesuji
Copy link
Contributor Author

tesuji commented Mar 15, 2020

I have a Windows box I can test on. What do I need to do to run the benchmark?

Thanks for the interests. And sorry the late reply. I was away from my computer in those days.

I created a repo for benchmarking at https://github.com/lzutao/rust-benches-wmemchr.
Hopefully I didn't do it wrongly because I am really just a newbie in writing benchmarks.

@tesuji
Copy link
Contributor Author

tesuji commented Mar 15, 2020

@wesleywiser Please see the post above.

@steveklabnik
Copy link
Member

I get

  = note: libwmemchr_benches-2a08054434623b1f.rlib(wmemchr_benches-2a08054434623b1f.wmemchr_benches.36qf1khe-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol wmemchr referen
ced in function _ZN15wmemchr_benches7wmemchr17h9b80c3fd6a1700a9E
          C:\Users\steve\tmp\rust-benches-wmemchr\target\release\deps\wmemchr-5e6bec10fe7e70eb.exe : fatal error LNK1120: 1 unresolved externals

when trying to run your benchmark.

@mati865
Copy link
Contributor

mati865 commented Mar 15, 2020

For windows-gnu on Ryzen R7 2700X box wmemchr variant is roughly twice as fast.
Results of cargo bench:

Details
Gnuplot not found, using plotters backend
Benchmarking small slice      [no null in slice]/iter::position
Benchmarking small slice      [no null in slice]/iter::position: Warming up for 3.0000 s
Benchmarking small slice      [no null in slice]/iter::position: Collecting 100 samples in estimated 5.0000 s (37M iterations)
Benchmarking small slice      [no null in slice]/iter::position: Analyzing
small slice      [no null in slice]/iter::position
                        time:   [132.00 ns 132.52 ns 133.09 ns]
                        change: [-1.8419% -1.2738% -0.7000%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe
Benchmarking small slice      [no null in slice]/wmemchr
Benchmarking small slice      [no null in slice]/wmemchr: Warming up for 3.0000 s
Benchmarking small slice      [no null in slice]/wmemchr: Collecting 100 samples in estimated 5.0003 s (66M iterations)
Benchmarking small slice      [no null in slice]/wmemchr: Analyzing
small slice      [no null in slice]/wmemchr
                        time:   [75.364 ns 75.735 ns 76.131 ns]
                        change: [-1.5130% -0.9615% -0.3817%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

Benchmarking small slice      [null in the middle of slice]/iter::position
Benchmarking small slice      [null in the middle of slice]/iter::position: Warming up for 3.0000 s
Benchmarking small slice      [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0003 s (48M iterations)
Benchmarking small slice      [null in the middle of slice]/iter::position: Analyzing
small slice      [null in the middle of slice]/iter::position
                        time:   [104.68 ns 105.02 ns 105.38 ns]
                        change: [-0.9901% -0.5467% -0.1005%] (p = 0.02 < 0.05)
                        Change within noise threshold.
Found 7 outliers among 100 measurements (7.00%)
  7 (7.00%) high mild
Benchmarking small slice      [null in the middle of slice]/wmemchr
Benchmarking small slice      [null in the middle of slice]/wmemchr: Warming up for 3.0000 s
Benchmarking small slice      [null in the middle of slice]/wmemchr: Collecting 100 samples in estimated 5.0002 s (81M iterations)
Benchmarking small slice      [null in the middle of slice]/wmemchr: Analyzing
small slice      [null in the middle of slice]/wmemchr
                        time:   [61.391 ns 61.607 ns 61.838 ns]
                        change: [-0.5171% -0.1115% +0.2818%] (p = 0.60 > 0.05)
                        No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild

Benchmarking small slice      [null at the end of slice]/iter::position
Benchmarking small slice      [null at the end of slice]/iter::position: Warming up for 3.0000 s
Benchmarking small slice      [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.0005 s (37M iterations)
Benchmarking small slice      [null at the end of slice]/iter::position: Analyzing
small slice      [null at the end of slice]/iter::position
                        time:   [134.30 ns 134.75 ns 135.25 ns]
                        change: [-1.1961% -0.7560% -0.3037%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 10 outliers among 100 measurements (10.00%)
  1 (1.00%) low severe
  9 (9.00%) high mild
Benchmarking small slice      [null at the end of slice]/wmemchr
Benchmarking small slice      [null at the end of slice]/wmemchr: Warming up for 3.0000 s
Benchmarking small slice      [null at the end of slice]/wmemchr: Collecting 100 samples in estimated 5.0000 s (66M iterations)
Benchmarking small slice      [null at the end of slice]/wmemchr: Analyzing
small slice      [null at the end of slice]/wmemchr
                        time:   [76.419 ns 76.654 ns 76.929 ns]
                        change: [-1.2010% -0.7157% -0.2252%] (p = 0.01 < 0.05)
                        Change within noise threshold.
Found 10 outliers among 100 measurements (10.00%)
  10 (10.00%) high mild

Benchmarking [medium slice    [no null in slice]/iter::position
Benchmarking [medium slice    [no null in slice]/iter::position: Warming up for 3.0000 s
Benchmarking [medium slice    [no null in slice]/iter::position: Collecting 100 samples in estimated 5.0980 s (162k iterations)
Benchmarking [medium slice    [no null in slice]/iter::position: Analyzing
[medium slice    [no null in slice]/iter::position
                        time:   [31.464 us 31.564 us 31.673 us]
                        change: [-0.6138% -0.1810% +0.2327%] (p = 0.41 > 0.05)
                        No change in performance detected.
Benchmarking [medium slice    [no null in slice]/wmemchr
Benchmarking [medium slice    [no null in slice]/wmemchr: Warming up for 3.0000 s
Benchmarking [medium slice    [no null in slice]/wmemchr: Collecting 100 samples in estimated 5.0530 s (318k iterations)
Benchmarking [medium slice    [no null in slice]/wmemchr: Analyzing
[medium slice    [no null in slice]/wmemchr
                        time:   [15.824 us 15.912 us 16.027 us]
                        change: [-0.4151% +0.1534% +0.7968%] (p = 0.62 > 0.05)
                        No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe

Benchmarking medium slice     [null in the middle of slice]/iter::position
Benchmarking medium slice     [null in the middle of slice]/iter::position: Warming up for 3.0000 s
Benchmarking medium slice     [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0215 s (212k iterations)
Benchmarking medium slice     [null in the middle of slice]/iter::position: Analyzing
medium slice     [null in the middle of slice]/iter::position
                        time:   [23.649 us 23.728 us 23.813 us]
                        change: [-1.3613% -0.9745% -0.5564%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 11 outliers among 100 measurements (11.00%)
  10 (10.00%) high mild
  1 (1.00%) high severe
Benchmarking medium slice     [null in the middle of slice]/wmemchr
Benchmarking medium slice     [null in the middle of slice]/wmemchr: Warming up for 3.0000 s
Benchmarking medium slice     [null in the middle of slice]/wmemchr: Collecting 100 samples in estimated 5.0533 s (424k iterations)
Benchmarking medium slice     [null in the middle of slice]/wmemchr: Analyzing
medium slice     [null in the middle of slice]/wmemchr
                        time:   [11.838 us 11.881 us 11.928 us]
                        change: [-0.7297% -0.2970% +0.1571%] (p = 0.20 > 0.05)
                        No change in performance detected.
Found 13 outliers among 100 measurements (13.00%)
  13 (13.00%) high mild

Benchmarking medium slice     [null at the end of slice]/iter::position
Benchmarking medium slice     [null at the end of slice]/iter::position: Warming up for 3.0000 s
Benchmarking medium slice     [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.1239 s (162k iterations)
Benchmarking medium slice     [null at the end of slice]/iter::position: Analyzing
medium slice     [null at the end of slice]/iter::position
                        time:   [31.429 us 31.551 us 31.679 us]
                        change: [-1.3095% -0.7629% -0.2579%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Benchmarking medium slice     [null at the end of slice]/wmemchr
Benchmarking medium slice     [null at the end of slice]/wmemchr: Warming up for 3.0000 s
Benchmarking medium slice     [null at the end of slice]/wmemchr: Collecting 100 samples in estimated 5.0453 s (318k iterations)
Benchmarking medium slice     [null at the end of slice]/wmemchr: Analyzing
medium slice     [null at the end of slice]/wmemchr
                        time:   [15.737 us 15.800 us 15.866 us]
                        change: [-1.1871% -0.8049% -0.4046%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 10 outliers among 100 measurements (10.00%)
  10 (10.00%) high mild

$ rustc -Vv
rustc 1.43.0-nightly (c20d7eecb 2020-03-11)
binary: rustc
commit-hash: c20d7eecbc0928b57da8fe30b2ef8528e2bdd5be
commit-date: 2020-03-11
host: x86_64-pc-windows-gnu
release: 1.43.0-nightly
LLVM version: 9.0

@mati865
Copy link
Contributor

mati865 commented Mar 16, 2020

For window-gnu on Ryzen R7 2700X box wmemchr variant is roughly twice as fast

That's nice but gnu env uses memchr under the hood so wmemchr should be quite optimized there.

To be clear, windows-gnu doesn't use CRT for that but it's own implementation:
https://gitlab.com/mati865/mingw-w64-mirror/-/blob/7c03b11bf173944679102bbe0ac061842e2f594b/mingw-w64-crt/misc/wmemchr.c#L25


It's hard to explain but using exactly the same nightly on the same system, iter::position became about twice as fast today and is on pair with wmemchr.
Unrolled is roughly two times faster than them:

Details

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Benchmarking small slice      [no null in slice]/iter::position
Benchmarking small slice      [no null in slice]/iter::position: Warming up for 3.0000 s
Benchmarking small slice      [no null in slice]/iter::position: Collecting 100 samples in estimated 5.0002 s (64M iterations)
Benchmarking small slice      [no null in slice]/iter::position: Analyzing
small slice      [no null in slice]/iter::position
                        time:   [72.035 ns 72.096 ns 72.170 ns]
Benchmarking small slice      [no null in slice]/wmemchr
Benchmarking small slice      [no null in slice]/wmemchr: Warming up for 3.0000 s
Benchmarking small slice      [no null in slice]/wmemchr: Collecting 100 samples in estimated 5.0002 s (67M iterations)
Benchmarking small slice      [no null in slice]/wmemchr: Analyzing
small slice      [no null in slice]/wmemchr
                        time:   [74.066 ns 74.123 ns 74.191 ns]
Found 26 outliers among 100 measurements (26.00%)
  13 (13.00%) low mild
  9 (9.00%) high mild
  4 (4.00%) high severe
Benchmarking small slice      [no null in slice]/unrolled
Benchmarking small slice      [no null in slice]/unrolled: Warming up for 3.0000 s
Benchmarking small slice      [no null in slice]/unrolled: Collecting 100 samples in estimated 5.0001 s (130M iterations)
Benchmarking small slice      [no null in slice]/unrolled: Analyzing
small slice      [no null in slice]/unrolled
                        time:   [38.224 ns 38.261 ns 38.319 ns]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

Benchmarking small slice      [null in the middle of slice]/iter::position
Benchmarking small slice      [null in the middle of slice]/iter::position: Warming up for 3.0000 s
Benchmarking small slice      [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0001 s (85M iterations)
Benchmarking small slice      [null in the middle of slice]/iter::position: Analyzing
small slice      [null in the middle of slice]/iter::position
                        time:   [58.422 ns 58.495 ns 58.597 ns]
Found 24 outliers among 100 measurements (24.00%)
  8 (8.00%) low severe
  3 (3.00%) low mild
  4 (4.00%) high mild
  9 (9.00%) high severe
Benchmarking small slice      [null in the middle of slice]/wmemchr
Benchmarking small slice      [null in the middle of slice]/wmemchr: Warming up for 3.0000 s
Benchmarking small slice      [null in the middle of slice]/wmemchr: Collecting 100 samples in estimated 5.0001 s (82M iterations)
Benchmarking small slice      [null in the middle of slice]/wmemchr: Analyzing
small slice      [null in the middle of slice]/wmemchr
                        time:   [60.681 ns 60.768 ns 60.872 ns]
Found 19 outliers among 100 measurements (19.00%)
  2 (2.00%) low mild
  4 (4.00%) high mild
  13 (13.00%) high severe
Benchmarking small slice      [null in the middle of slice]/unrolled
Benchmarking small slice      [null in the middle of slice]/unrolled: Warming up for 3.0000 s
Benchmarking small slice      [null in the middle of slice]/unrolled: Collecting 100 samples in estimated 5.0001 s (173M iterations)
Benchmarking small slice      [null in the middle of slice]/unrolled: Analyzing
small slice      [null in the middle of slice]/unrolled
                        time:   [28.801 ns 28.828 ns 28.863 ns]
Found 24 outliers among 100 measurements (24.00%)
  2 (2.00%) low severe
  6 (6.00%) low mild
  3 (3.00%) high mild
  13 (13.00%) high severe

Benchmarking small slice      [null at the end of slice]/iter::position
Benchmarking small slice      [null at the end of slice]/iter::position: Warming up for 3.0000 s
Benchmarking small slice      [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.0003 s (68M iterations)
Benchmarking small slice      [null at the end of slice]/iter::position: Analyzing
small slice      [null at the end of slice]/iter::position
                        time:   [73.022 ns 73.115 ns 73.227 ns]
Found 16 outliers among 100 measurements (16.00%)
  7 (7.00%) low mild
  5 (5.00%) high mild
  4 (4.00%) high severe
Benchmarking small slice      [null at the end of slice]/wmemchr
Benchmarking small slice      [null at the end of slice]/wmemchr: Warming up for 3.0000 s
Benchmarking small slice      [null at the end of slice]/wmemchr: Collecting 100 samples in estimated 5.0001 s (65M iterations)
Benchmarking small slice      [null at the end of slice]/wmemchr: Analyzing
small slice      [null at the end of slice]/wmemchr
                        time:   [76.097 ns 76.297 ns 76.520 ns]
Benchmarking small slice      [null at the end of slice]/unrolled
Benchmarking small slice      [null at the end of slice]/unrolled: Warming up for 3.0000 s
Benchmarking small slice      [null at the end of slice]/unrolled: Collecting 100 samples in estimated 5.0001 s (130M iterations)
Benchmarking small slice      [null at the end of slice]/unrolled: Analyzing
small slice      [null at the end of slice]/unrolled
                        time:   [38.251 ns 38.301 ns 38.366 ns]
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) high mild
  7 (7.00%) high severe

Benchmarking [medium slice    [no null in slice]/iter::position
Benchmarking [medium slice    [no null in slice]/iter::position: Warming up for 3.0000 s
Benchmarking [medium slice    [no null in slice]/iter::position: Collecting 100 samples in estimated 5.0054 s (323k iterations)
Benchmarking [medium slice    [no null in slice]/iter::position: Analyzing
[medium slice    [no null in slice]/iter::position
                        time:   [15.424 us 15.437 us 15.451 us]
Found 17 outliers among 100 measurements (17.00%)
  5 (5.00%) low mild
  8 (8.00%) high mild
  4 (4.00%) high severe
Benchmarking [medium slice    [no null in slice]/wmemchr
Benchmarking [medium slice    [no null in slice]/wmemchr: Warming up for 3.0000 s
Benchmarking [medium slice    [no null in slice]/wmemchr: Collecting 100 samples in estimated 5.0184 s (323k iterations)
Benchmarking [medium slice    [no null in slice]/wmemchr: Analyzing
[medium slice    [no null in slice]/wmemchr
                        time:   [15.527 us 15.564 us 15.606 us]
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe
Benchmarking [medium slice    [no null in slice]/unrolled
Benchmarking [medium slice    [no null in slice]/unrolled: Warming up for 3.0000 s
Benchmarking [medium slice    [no null in slice]/unrolled: Collecting 100 samples in estimated 5.0231 s (520k iterations)
Benchmarking [medium slice    [no null in slice]/unrolled: Analyzing
[medium slice    [no null in slice]/unrolled
                        time:   [9.6392 us 9.6740 us 9.7123 us]
Found 10 outliers among 100 measurements (10.00%)
  3 (3.00%) high mild
  7 (7.00%) high severe

Benchmarking medium slice     [null in the middle of slice]/iter::position
Benchmarking medium slice     [null in the middle of slice]/iter::position: Warming up for 3.0000 s
Benchmarking medium slice     [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0310 s (434k iterations)
Benchmarking medium slice     [null in the middle of slice]/iter::position: Analyzing
medium slice     [null in the middle of slice]/iter::position
                        time:   [11.540 us 11.563 us 11.593 us]
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe
Benchmarking medium slice     [null in the middle of slice]/wmemchr
Benchmarking medium slice     [null in the middle of slice]/wmemchr: Warming up for 3.0000 s
Benchmarking medium slice     [null in the middle of slice]/wmemchr: Collecting 100 samples in estimated 5.0271 s (434k iterations)
Benchmarking medium slice     [null in the middle of slice]/wmemchr: Analyzing
medium slice     [null in the middle of slice]/wmemchr
                        time:   [11.563 us 11.580 us 11.602 us]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) low mild
  4 (4.00%) high mild
  1 (1.00%) high severe
Benchmarking medium slice     [null in the middle of slice]/unrolled
Benchmarking medium slice     [null in the middle of slice]/unrolled: Warming up for 3.0000 s
Benchmarking medium slice     [null in the middle of slice]/unrolled: Collecting 100 samples in estimated 5.0178 s (692k iterations)
Benchmarking medium slice     [null in the middle of slice]/unrolled: Analyzing
medium slice     [null in the middle of slice]/unrolled
                        time:   [7.2313 us 7.2489 us 7.2777 us]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

Benchmarking medium slice     [null at the end of slice]/iter::position
Benchmarking medium slice     [null at the end of slice]/iter::position: Warming up for 3.0000 s
Benchmarking medium slice     [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.0141 s (323k iterations)
Benchmarking medium slice     [null at the end of slice]/iter::position: Analyzing
medium slice     [null at the end of slice]/iter::position
                        time:   [15.472 us 15.501 us 15.539 us]
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high severe
Benchmarking medium slice     [null at the end of slice]/wmemchr
Benchmarking medium slice     [null at the end of slice]/wmemchr: Warming up for 3.0000 s
Benchmarking medium slice     [null at the end of slice]/wmemchr: Collecting 100 samples in estimated 5.0022 s (323k iterations)
Benchmarking medium slice     [null at the end of slice]/wmemchr: Analyzing
medium slice     [null at the end of slice]/wmemchr
                        time:   [15.418 us 15.436 us 15.455 us]
Found 23 outliers among 100 measurements (23.00%)
  7 (7.00%) low mild
  10 (10.00%) high mild
  6 (6.00%) high severe
Benchmarking medium slice     [null at the end of slice]/unrolled
Benchmarking medium slice     [null at the end of slice]/unrolled: Warming up for 3.0000 s
Benchmarking medium slice     [null at the end of slice]/unrolled: Collecting 100 samples in estimated 5.0318 s (520k iterations)
Benchmarking medium slice     [null at the end of slice]/unrolled: Analyzing
medium slice     [null at the end of slice]/unrolled
                        time:   [9.6401 us 9.6443 us 9.6490 us]
Found 28 outliers among 100 measurements (28.00%)
  11 (11.00%) low mild
  10 (10.00%) high mild
  7 (7.00%) high severe

@tesuji tesuji changed the title Use wmemchr for searching NULL in [u16] on Windows Use unrolled loop for searching NULL in [u16] on Windows Mar 16, 2020
@tesuji
Copy link
Contributor Author

tesuji commented Mar 16, 2020

I don't know why but for MSVC targets, the unrolled loop version is
significantly faster (more than 3 times) than using naive iter::position:

2020-03-16T14:29:20.2162262Z Benchmarking small slice      [no null in slice]/iter::position
2020-03-16T14:29:20.2162749Z Benchmarking small slice      [no null in slice]/iter::position: Warming up for 3.0000 s
2020-03-16T14:29:23.8782815Z Benchmarking small slice      [no null in slice]/iter::position: Collecting 100 samples in estimated 5.0005 s (23M iterations)
2020-03-16T14:29:28.9715413Z Benchmarking small slice      [no null in slice]/iter::position: Analyzing
2020-03-16T14:29:29.5018719Z small slice      [no null in slice]/iter::position
2020-03-16T14:29:29.5019477Z                         time:   [219.52 ns 222.11 ns 224.81 ns]
2020-03-16T14:29:29.5019926Z Found 7 outliers among 100 measurements (7.00%)
2020-03-16T14:29:29.5020101Z   1 (1.00%) low mild
2020-03-16T14:29:29.5020227Z   5 (5.00%) high mild
2020-03-16T14:29:29.5020325Z   1 (1.00%) high severe
2020-03-16T14:29:32.4260194Z Benchmarking small slice      [no null in slice]/unrolled_find_u16s
2020-03-16T14:29:32.4260881Z Benchmarking small slice      [no null in slice]/unrolled_find_u16s: Warming up for 3.0000 s
2020-03-16T14:29:37.1346828Z Benchmarking small slice      [no null in slice]/unrolled_find_u16s: Collecting 100 samples in estimated 5.0001 s (71M iterations)
2020-03-16T14:29:42.1243475Z Benchmarking small slice      [no null in slice]/unrolled_find_u16s: Analyzing
2020-03-16T14:29:42.6792058Z small slice      [no null in slice]/unrolled_find_u16s
2020-03-16T14:29:42.6793172Z                         time:   [69.218 ns 70.512 ns 71.976 ns]
2020-03-16T14:29:42.6793383Z Found 7 outliers among 100 measurements (7.00%)
2020-03-16T14:29:42.6793522Z   6 (6.00%) high mild
2020-03-16T14:29:42.6793707Z   1 (1.00%) high severe
2020-03-16T14:29:45.5857201Z 
2020-03-16T14:29:45.5858011Z Benchmarking small slice      [null in the middle of slice]/iter::position
2020-03-16T14:29:45.5858404Z Benchmarking small slice      [null in the middle of slice]/iter::position: Warming up for 3.0000 s
2020-03-16T14:29:51.3992993Z Benchmarking small slice      [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0001 s (29M iterations)
2020-03-16T14:29:56.1807543Z Benchmarking small slice      [null in the middle of slice]/iter::position: Analyzing
2020-03-16T14:29:56.7414542Z small slice      [null in the middle of slice]/iter::position
2020-03-16T14:29:56.7414925Z                         time:   [164.70 ns 166.78 ns 168.88 ns]
2020-03-16T14:29:56.7415122Z Found 3 outliers among 100 measurements (3.00%)
2020-03-16T14:29:56.7415266Z   3 (3.00%) high mild
2020-03-16T14:29:59.4794153Z Benchmarking small slice      [null in the middle of slice]/unrolled_find_u16s
2020-03-16T14:29:59.4794906Z Benchmarking small slice      [null in the middle of slice]/unrolled_find_u16s: Warming up for 3.0000 s
2020-03-16T14:30:02.9465949Z Benchmarking small slice      [null in the middle of slice]/unrolled_find_u16s: Collecting 100 samples in estimated 5.0001 s (97M iterations)
2020-03-16T14:30:08.1407792Z Benchmarking small slice      [null in the middle of slice]/unrolled_find_u16s: Analyzing
2020-03-16T14:30:08.7448619Z small slice      [null in the middle of slice]/unrolled_find_u16s
2020-03-16T14:30:08.7449073Z                         time:   [52.376 ns 53.121 ns 53.956 ns]
2020-03-16T14:30:08.7449327Z Found 1 outliers among 100 measurements (1.00%)
2020-03-16T14:30:08.7449492Z   1 (1.00%) high mild
2020-03-16T14:30:11.5719824Z 
2020-03-16T14:30:11.5720662Z Benchmarking small slice      [null at the end of slice]/iter::position
2020-03-16T14:30:11.5721076Z Benchmarking small slice      [null at the end of slice]/iter::position: Warming up for 3.0000 s
2020-03-16T14:30:15.2047827Z Benchmarking small slice      [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.0002 s (23M iterations)
2020-03-16T14:30:20.2975991Z Benchmarking small slice      [null at the end of slice]/iter::position: Analyzing
2020-03-16T14:30:20.8865399Z small slice      [null at the end of slice]/iter::position
2020-03-16T14:30:20.8866246Z                         time:   [218.59 ns 221.15 ns 223.80 ns]
2020-03-16T14:30:20.8866545Z Found 4 outliers among 100 measurements (4.00%)
2020-03-16T14:30:20.8866699Z   3 (3.00%) high mild
2020-03-16T14:30:20.8866837Z   1 (1.00%) high severe
2020-03-16T14:30:23.8637656Z Benchmarking small slice      [null at the end of slice]/unrolled_find_u16s
2020-03-16T14:30:23.8638462Z Benchmarking small slice      [null at the end of slice]/unrolled_find_u16s: Warming up for 3.0000 s
2020-03-16T14:30:29.0538522Z Benchmarking small slice      [null at the end of slice]/unrolled_find_u16s: Collecting 100 samples in estimated 5.0002 s (65M iterations)
2020-03-16T14:30:34.0245124Z Benchmarking small slice      [null at the end of slice]/unrolled_find_u16s: Analyzing
2020-03-16T14:30:34.6421960Z small slice      [null at the end of slice]/unrolled_find_u16s
2020-03-16T14:30:34.6422793Z                         time:   [75.921 ns 76.719 ns 77.561 ns]
2020-03-16T14:30:34.6423283Z Found 8 outliers among 100 measurements (8.00%)
2020-03-16T14:30:34.6423496Z   6 (6.00%) high mild
2020-03-16T14:30:34.6423636Z   2 (2.00%) high severe
2020-03-16T14:30:37.6192398Z 
2020-03-16T14:30:37.6199784Z Benchmarking [medium slice    [no null in slice]/iter::position
2020-03-16T14:30:37.6200577Z Benchmarking [medium slice    [no null in slice]/iter::position: Warming up for 3.0000 s
2020-03-16T14:30:41.2084076Z Benchmarking [medium slice    [no null in slice]/iter::position: Collecting 100 samples in estimated 5.2535 s (96k iterations)
2020-03-16T14:30:46.4540025Z Benchmarking [medium slice    [no null in slice]/iter::position: Analyzing
2020-03-16T14:30:47.0066179Z [medium slice    [no null in slice]/iter::position
2020-03-16T14:30:47.0066645Z                         time:   [54.090 us 54.626 us 55.182 us]
2020-03-16T14:30:47.0066880Z Found 7 outliers among 100 measurements (7.00%)
2020-03-16T14:30:47.0067035Z   1 (1.00%) low mild
2020-03-16T14:30:47.0067178Z   5 (5.00%) high mild
2020-03-16T14:30:47.0067316Z   1 (1.00%) high severe
2020-03-16T14:30:49.8589791Z Benchmarking [medium slice    [no null in slice]/unrolled_find_u16s
2020-03-16T14:30:49.8590289Z Benchmarking [medium slice    [no null in slice]/unrolled_find_u16s: Warming up for 3.0000 s
2020-03-16T14:30:54.3039069Z Benchmarking [medium slice    [no null in slice]/unrolled_find_u16s: Collecting 100 samples in estimated 5.0520 s (298k iterations)
2020-03-16T14:30:59.3659407Z Benchmarking [medium slice    [no null in slice]/unrolled_find_u16s: Analyzing
2020-03-16T14:30:59.9253506Z [medium slice    [no null in slice]/unrolled_find_u16s
2020-03-16T14:30:59.9256292Z                         time:   [16.948 us 17.140 us 17.324 us]
2020-03-16T14:30:59.9256501Z Found 3 outliers among 100 measurements (3.00%)
2020-03-16T14:30:59.9256639Z   2 (2.00%) high mild
2020-03-16T14:30:59.9256769Z   1 (1.00%) high severe
2020-03-16T14:31:02.7353767Z 
2020-03-16T14:31:02.7360974Z Benchmarking medium slice     [null in the middle of slice]/iter::position
2020-03-16T14:31:02.7361373Z Benchmarking medium slice     [null in the middle of slice]/iter::position: Warming up for 3.0000 s
2020-03-16T14:31:08.1558057Z Benchmarking medium slice     [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0114 s (121k iterations)
2020-03-16T14:31:13.1419248Z Benchmarking medium slice     [null in the middle of slice]/iter::position: Analyzing
2020-03-16T14:31:13.7206340Z medium slice     [null in the middle of slice]/iter::position
2020-03-16T14:31:13.7206727Z                         time:   [40.644 us 41.100 us 41.576 us]
2020-03-16T14:31:13.7207103Z Found 3 outliers among 100 measurements (3.00%)
2020-03-16T14:31:13.7207535Z   2 (2.00%) high mild
2020-03-16T14:31:13.7207703Z   1 (1.00%) high severe
2020-03-16T14:31:16.6613885Z Benchmarking medium slice     [null in the middle of slice]/unrolled_find_u16s
2020-03-16T14:31:16.6614483Z Benchmarking medium slice     [null in the middle of slice]/unrolled_find_u16s: Warming up for 3.0000 s
2020-03-16T14:31:20.0137134Z Benchmarking medium slice     [null in the middle of slice]/unrolled_find_u16s: Collecting 100 samples in estimated 5.0370 s (394k iterations)
2020-03-16T14:31:25.0454210Z Benchmarking medium slice     [null in the middle of slice]/unrolled_find_u16s: Analyzing
2020-03-16T14:31:25.6317781Z medium slice     [null in the middle of slice]/unrolled_find_u16s
2020-03-16T14:31:25.6318360Z                         time:   [12.624 us 12.764 us 12.909 us]
2020-03-16T14:31:25.6318558Z Found 6 outliers among 100 measurements (6.00%)
2020-03-16T14:31:25.6318716Z   1 (1.00%) low mild
2020-03-16T14:31:25.6318848Z   2 (2.00%) high mild
2020-03-16T14:31:25.6318997Z   3 (3.00%) high severe
2020-03-16T14:31:28.7253894Z 
2020-03-16T14:31:28.7254566Z Benchmarking medium slice     [null at the end of slice]/iter::position
2020-03-16T14:31:28.7268781Z Benchmarking medium slice     [null at the end of slice]/iter::position: Warming up for 3.0000 s
2020-03-16T14:31:32.1524434Z Benchmarking medium slice     [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.0543 s (91k iterations)
2020-03-16T14:31:37.2786616Z Benchmarking medium slice     [null at the end of slice]/iter::position: Analyzing
2020-03-16T14:31:37.8509977Z medium slice     [null at the end of slice]/iter::position
2020-03-16T14:31:37.8511275Z                         time:   [55.292 us 56.521 us 57.965 us]
2020-03-16T14:31:37.8511545Z Found 7 outliers among 100 measurements (7.00%)
2020-03-16T14:31:37.8512080Z   4 (4.00%) high mild
2020-03-16T14:31:37.8512371Z   3 (3.00%) high severe
2020-03-16T14:31:40.8542484Z Benchmarking medium slice     [null at the end of slice]/unrolled_find_u16s
2020-03-16T14:31:40.8544492Z Benchmarking medium slice     [null at the end of slice]/unrolled_find_u16s: Warming up for 3.0000 s
2020-03-16T14:31:45.3424395Z Benchmarking medium slice     [null at the end of slice]/unrolled_find_u16s: Collecting 100 samples in estimated 5.0146 s (293k iterations)
2020-03-16T14:31:50.3563822Z Benchmarking medium slice     [null at the end of slice]/unrolled_find_u16s: Analyzing
2020-03-16T14:31:50.9075861Z medium slice     [null at the end of slice]/unrolled_find_u16s
2020-03-16T14:31:50.9076626Z                         time:   [16.737 us 16.978 us 17.244 us]
2020-03-16T14:31:50.9076853Z Found 4 outliers among 100 measurements (4.00%)
2020-03-16T14:31:50.9077020Z   4 (4.00%) high severe

@mati865
Copy link
Contributor

mati865 commented Mar 16, 2020

@lzutao benchmarking iter::position is somehow nonreproducible. Unrolled function performs similarly between windows-gnu and windows-msvc but iter::position does not.
That's the same inconsistency I've encountered locally with windows-gnu.

@wesleywiser
Copy link
Member

When building libcore are you using x.py build -i ... or x.py build ...? (Or do you have incremental = true in your config.toml?)

Using incremental compilation can have a huge impact on micro-benchmarks like this due to CGU partitioning.

@mati865
Copy link
Contributor

mati865 commented Mar 16, 2020

@wesleywiser in my case it was official nightly windows-gnu (the same build) running this benchmark: https://github.com/lzutao/rust-benches-wmemchr/blob/d545e5b5ae48dcf6c4071b86995a32d4da6aebe3/benches/wmemchr.rs
Today iter::position ran twice as fast for me (did multiple runs yesterday and today), calling mingw-w64 wmemchr from Rust code gave identical performance as yesterday.

Now on the CI, iter::position on windows-gnu ran almost two times faster than on windows-msvc

No idea whether that benchmark has some bug or what.

@tesuji
Copy link
Contributor Author

tesuji commented Mar 17, 2020

I ported the unrolled version (godbolt link) to use iter.next() from C-like iterative version.
The new version is even slower than iter::position.

2020-03-17T02:59:07.7959741Z Benchmarking small slice      [no null in slice]/iter::position
2020-03-17T02:59:07.7960302Z Benchmarking small slice      [no null in slice]/iter::position: Warming up for 3.0000 s
2020-03-17T02:59:12.5521904Z Benchmarking small slice      [no null in slice]/iter::position: Collecting 100 samples in estimated 5.0003 s (35M iterations)
2020-03-17T02:59:17.5089736Z Benchmarking small slice      [no null in slice]/iter::position: Analyzing
2020-03-17T02:59:18.0447587Z small slice      [no null in slice]/iter::position
2020-03-17T02:59:18.0448195Z                         time:   [139.12 ns 140.17 ns 141.31 ns]
2020-03-17T02:59:18.0448428Z Found 6 outliers among 100 measurements (6.00%)
2020-03-17T02:59:18.0448605Z   2 (2.00%) low mild
2020-03-17T02:59:18.0448765Z   1 (1.00%) high mild
2020-03-17T02:59:18.0449050Z   3 (3.00%) high severe
2020-03-17T02:59:20.9534887Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr
2020-03-17T02:59:20.9535538Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-17T02:59:25.6899859Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0004 s (35M iterations)
2020-03-17T02:59:30.6684357Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr: Analyzing
2020-03-17T02:59:31.1942553Z small slice      [no null in slice]/unrollled_wmemchr
2020-03-17T02:59:31.1943682Z                         time:   [139.40 ns 140.29 ns 141.25 ns]
2020-03-17T02:59:31.1943874Z Found 6 outliers among 100 measurements (6.00%)
2020-03-17T02:59:31.1944346Z   4 (4.00%) high mild
2020-03-17T02:59:31.1944574Z   2 (2.00%) high severe
2020-03-17T02:59:34.0827686Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr_iterative
2020-03-17T02:59:34.0828418Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-17T02:59:38.4958167Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0000 s (76M iterations)
2020-03-17T02:59:43.5470688Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-17T02:59:44.0980839Z small slice      [no null in slice]/unrollled_wmemchr_iterative
2020-03-17T02:59:44.0981259Z                         time:   [65.842 ns 66.319 ns 66.822 ns]
2020-03-17T02:59:44.0981801Z Found 4 outliers among 100 measurements (4.00%)
2020-03-17T02:59:44.0982039Z   2 (2.00%) high mild
2020-03-17T02:59:44.0982183Z   2 (2.00%) high severe
2020-03-17T02:59:46.9960774Z 
2020-03-17T02:59:46.9961379Z Benchmarking small slice      [null in the middle of slice]/iter::position
2020-03-17T02:59:46.9961602Z Benchmarking small slice      [null in the middle of slice]/iter::position: Warming up for 3.0000 s
2020-03-17T02:59:50.5330379Z Benchmarking small slice      [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0005 s (46M iterations)
2020-03-17T02:59:55.4869062Z Benchmarking small slice      [null in the middle of slice]/iter::position: Analyzing
2020-03-17T02:59:56.0411538Z small slice      [null in the middle of slice]/iter::position
2020-03-17T02:59:56.0411955Z                         time:   [106.27 ns 107.17 ns 108.04 ns]
2020-03-17T02:59:56.0412155Z Found 2 outliers among 100 measurements (2.00%)
2020-03-17T02:59:56.0412311Z   2 (2.00%) high severe
2020-03-17T02:59:58.9189984Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr
2020-03-17T02:59:58.9190662Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-17T03:00:02.2576667Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0004 s (50M iterations)
2020-03-17T03:00:07.1914356Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr: Analyzing
2020-03-17T03:00:07.7590967Z small slice      [null in the middle of slice]/unrollled_wmemchr
2020-03-17T03:00:07.7591823Z                         time:   [97.227 ns 98.222 ns 99.230 ns]
2020-03-17T03:00:07.7592216Z Found 3 outliers among 100 measurements (3.00%)
2020-03-17T03:00:07.7592404Z   1 (1.00%) high mild
2020-03-17T03:00:07.7592548Z   2 (2.00%) high severe
2020-03-17T03:00:10.5232619Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr_iterative
2020-03-17T03:00:10.5233562Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-17T03:00:13.7747897Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0001 s (103M iterations)
2020-03-17T03:00:18.8446740Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-17T03:00:19.3759380Z small slice      [null in the middle of slice]/unrollled_wmemchr_iterative
2020-03-17T03:00:19.3760092Z                         time:   [48.565 ns 49.073 ns 49.604 ns]
2020-03-17T03:00:19.3760437Z Found 6 outliers among 100 measurements (6.00%)
2020-03-17T03:00:19.3760716Z   2 (2.00%) low mild
2020-03-17T03:00:19.3761024Z   4 (4.00%) high mild
2020-03-17T03:00:22.1500423Z 
2020-03-17T03:00:22.1501296Z Benchmarking small slice      [null at the end of slice]/iter::position
2020-03-17T03:00:22.1501917Z Benchmarking small slice      [null at the end of slice]/iter::position: Warming up for 3.0000 s
2020-03-17T03:00:26.6119231Z Benchmarking small slice      [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.0006 s (38M iterations)
2020-03-17T03:00:31.5502387Z Benchmarking small slice      [null at the end of slice]/iter::position: Analyzing
2020-03-17T03:00:32.1133803Z small slice      [null at the end of slice]/iter::position
2020-03-17T03:00:32.1134247Z                         time:   [130.29 ns 131.44 ns 132.76 ns]
2020-03-17T03:00:32.1135563Z Found 6 outliers among 100 measurements (6.00%)
2020-03-17T03:00:32.1135716Z   1 (1.00%) low mild
2020-03-17T03:00:32.1135852Z   2 (2.00%) high mild
2020-03-17T03:00:32.1135983Z   3 (3.00%) high severe
2020-03-17T03:00:34.8063948Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr
2020-03-17T03:00:34.8064612Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-17T03:00:39.2312501Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0004 s (38M iterations)
2020-03-17T03:00:44.2737396Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr: Analyzing
2020-03-17T03:00:44.8261462Z small slice      [null at the end of slice]/unrollled_wmemchr
2020-03-17T03:00:44.8261931Z                         time:   [131.84 ns 133.08 ns 134.31 ns]
2020-03-17T03:00:44.8262078Z Found 4 outliers among 100 measurements (4.00%)
2020-03-17T03:00:44.8262217Z   2 (2.00%) low mild
2020-03-17T03:00:44.8262333Z   2 (2.00%) high mild
2020-03-17T03:00:47.6056707Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr_iterative
2020-03-17T03:00:47.6057350Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-17T03:00:52.3517376Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0002 s (71M iterations)
2020-03-17T03:00:57.4257129Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-17T03:00:57.9761099Z small slice      [null at the end of slice]/unrollled_wmemchr_iterative
2020-03-17T03:00:57.9761619Z                         time:   [71.023 ns 71.898 ns 72.788 ns]
2020-03-17T03:00:57.9761799Z Found 4 outliers among 100 measurements (4.00%)
2020-03-17T03:00:57.9761976Z   3 (3.00%) high mild
2020-03-17T03:00:57.9762122Z   1 (1.00%) high severe
2020-03-17T03:01:00.8441608Z 
2020-03-17T03:01:00.8448300Z Benchmarking [medium slice    [no null in slice]/iter::position
2020-03-17T03:01:00.8448728Z Benchmarking [medium slice    [no null in slice]/iter::position: Warming up for 3.0000 s
2020-03-17T03:01:05.0885174Z Benchmarking [medium slice    [no null in slice]/iter::position: Collecting 100 samples in estimated 5.0684 s (157k iterations)
2020-03-17T03:01:10.2419709Z Benchmarking [medium slice    [no null in slice]/iter::position: Analyzing
2020-03-17T03:01:10.8070960Z [medium slice    [no null in slice]/iter::position
2020-03-17T03:01:10.8071394Z                         time:   [32.521 us 32.955 us 33.416 us]
2020-03-17T03:01:10.8071618Z Found 6 outliers among 100 measurements (6.00%)
2020-03-17T03:01:10.8071789Z   6 (6.00%) high mild
2020-03-17T03:01:13.7151109Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr
2020-03-17T03:01:13.7151845Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-17T03:01:17.9811811Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0952 s (157k iterations)
2020-03-17T03:01:22.9156803Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr: Analyzing
2020-03-17T03:01:23.4883515Z [medium slice    [no null in slice]/unrollled_wmemchr
2020-03-17T03:01:23.4884368Z                         time:   [31.236 us 31.588 us 31.951 us]
2020-03-17T03:01:23.4884777Z Found 6 outliers among 100 measurements (6.00%)
2020-03-17T03:01:23.4884940Z   1 (1.00%) low mild
2020-03-17T03:01:23.4885077Z   4 (4.00%) high mild
2020-03-17T03:01:23.4885210Z   1 (1.00%) high severe
2020-03-17T03:01:26.3335320Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr_iterative
2020-03-17T03:01:26.3335914Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-17T03:01:30.4809171Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0333 s (318k iterations)
2020-03-17T03:01:35.5088987Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-17T03:01:36.0332970Z [medium slice    [no null in slice]/unrollled_wmemchr_iterative
2020-03-17T03:01:36.0333320Z                         time:   [15.581 us 15.717 us 15.869 us]
2020-03-17T03:01:36.0333736Z Found 6 outliers among 100 measurements (6.00%)
2020-03-17T03:01:36.0334028Z   2 (2.00%) low mild
2020-03-17T03:01:36.0334177Z   2 (2.00%) high mild
2020-03-17T03:01:36.0334313Z   2 (2.00%) high severe
2020-03-17T03:01:38.8365147Z 
2020-03-17T03:01:38.8373364Z Benchmarking medium slice     [null in the middle of slice]/iter::position
2020-03-17T03:01:38.8373813Z Benchmarking medium slice     [null in the middle of slice]/iter::position: Warming up for 3.0000 s
2020-03-17T03:01:41.9386072Z Benchmarking medium slice     [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0184 s (212k iterations)
2020-03-17T03:01:46.9762149Z Benchmarking medium slice     [null in the middle of slice]/iter::position: Analyzing
2020-03-17T03:01:47.5537644Z medium slice     [null in the middle of slice]/iter::position
2020-03-17T03:01:47.5538048Z                         time:   [23.442 us 23.748 us 24.076 us]
2020-03-17T03:01:47.5538253Z Found 6 outliers among 100 measurements (6.00%)
2020-03-17T03:01:47.5538400Z   6 (6.00%) high mild
2020-03-17T03:01:50.3696831Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr
2020-03-17T03:01:50.3697859Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-17T03:01:53.6333089Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0295 s (202k iterations)
2020-03-17T03:01:58.4954888Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr: Analyzing
2020-03-17T03:01:59.0384269Z medium slice     [null in the middle of slice]/unrollled_wmemchr
2020-03-17T03:01:59.0384735Z                         time:   [23.664 us 24.032 us 24.465 us]
2020-03-17T03:01:59.0384905Z Found 5 outliers among 100 measurements (5.00%)
2020-03-17T03:01:59.0385055Z   4 (4.00%) high mild
2020-03-17T03:01:59.0385158Z   1 (1.00%) high severe
2020-03-17T03:02:01.7485652Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative
2020-03-17T03:02:01.7486524Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-17T03:02:04.8732905Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0563 s (424k iterations)
2020-03-17T03:02:09.9074814Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-17T03:02:10.4428466Z medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative
2020-03-17T03:02:10.4429038Z                         time:   [11.736 us 11.887 us 12.064 us]
2020-03-17T03:02:10.4429196Z Found 9 outliers among 100 measurements (9.00%)
2020-03-17T03:02:10.4429346Z   1 (1.00%) low mild
2020-03-17T03:02:10.4429479Z   6 (6.00%) high mild
2020-03-17T03:02:10.4429607Z   2 (2.00%) high severe
2020-03-17T03:02:13.2204822Z 
2020-03-17T03:02:13.2211303Z Benchmarking medium slice     [null at the end of slice]/iter::position
2020-03-17T03:02:13.2212574Z Benchmarking medium slice     [null at the end of slice]/iter::position: Warming up for 3.0000 s
2020-03-17T03:02:17.4054847Z Benchmarking medium slice     [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.1587 s (162k iterations)
2020-03-17T03:02:22.5085547Z Benchmarking medium slice     [null at the end of slice]/iter::position: Analyzing
2020-03-17T03:02:23.0008615Z medium slice     [null at the end of slice]/iter::position
2020-03-17T03:02:23.0009150Z                         time:   [31.180 us 31.628 us 32.129 us]
2020-03-17T03:02:23.0009485Z Found 4 outliers among 100 measurements (4.00%)
2020-03-17T03:02:23.0009647Z   4 (4.00%) high mild
2020-03-17T03:02:25.6915916Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr
2020-03-17T03:02:25.6916563Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-17T03:02:29.9237013Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0546 s (157k iterations)
2020-03-17T03:02:35.0077180Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr: Analyzing
2020-03-17T03:02:35.5631248Z medium slice     [null at the end of slice]/unrollled_wmemchr
2020-03-17T03:02:35.5631595Z                         time:   [32.199 us 32.566 us 32.961 us]
2020-03-17T03:02:35.5631770Z Found 6 outliers among 100 measurements (6.00%)
2020-03-17T03:02:35.5631918Z   5 (5.00%) high mild
2020-03-17T03:02:35.5632015Z   1 (1.00%) high severe
2020-03-17T03:02:38.4072961Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr_iterative
2020-03-17T03:02:38.4073735Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-17T03:02:42.6676887Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0063 s (308k iterations)
2020-03-17T03:02:47.5868197Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-17T03:02:48.1748724Z medium slice     [null at the end of slice]/unrollled_wmemchr_iterative
2020-03-17T03:02:48.1749223Z                         time:   [15.857 us 16.100 us 16.338 us]
2020-03-17T03:02:48.1750416Z Found 1 outliers among 100 measurements (1.00%)
2020-03-17T03:02:48.1750594Z   1 (1.00%) high mild

Is this an optimization bug or not?

@tesuji
Copy link
Contributor Author

tesuji commented Mar 17, 2020

@lzutao benchmarking iter::position is somehow nonreproducible

I encourtered the same situation. Now the iter::position on msvc
is as twice as faster than gnu. Honestly, I have no ideas.

@wesleywiser
Copy link
Member

I took a look in jsstr.cpp which is the file that the linked Firefox patch applies to and I'm now concerned that unrolling the loop will hurt performance on 32-bit Windows. See https://hg.mozilla.org/mozilla-central/file/f262c389193e/js/src/jsstr.cpp#l901

We should either confirm that this does not pessimize 32-bit Windows or only use this implementation on 64-bit Windows falling back to the existing code on 32-bit Windows.

@tesuji
Copy link
Contributor Author

tesuji commented Mar 18, 2020

I benched it against 32-bit Windows (for both gnu and msvc) on Github Actions.
The unrolling loop is roughly 2 times faster than iter::position too.

2020-03-18T05:49:52.0345983Z Benchmarking small slice      [no null in slice]/iter::position
2020-03-18T05:49:52.0346454Z Benchmarking small slice      [no null in slice]/iter::position: Warming up for 3.0000 s
2020-03-18T05:49:56.4560647Z Benchmarking small slice      [no null in slice]/iter::position: Collecting 100 samples in estimated 5.0007 s (38M iterations)
2020-03-18T05:50:01.4724117Z Benchmarking small slice      [no null in slice]/iter::position: Analyzing
2020-03-18T05:50:02.2363932Z small slice      [no null in slice]/iter::position
2020-03-18T05:50:02.2366010Z                         time:   [130.65 ns 132.68 ns 134.83 ns]
2020-03-18T05:50:02.2366244Z Found 2 outliers among 100 measurements (2.00%)
2020-03-18T05:50:02.2366789Z   2 (2.00%) high mild
2020-03-18T05:50:06.6104616Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr
2020-03-18T05:50:06.6105304Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-18T05:50:11.1560787Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0005 s (37M iterations)
2020-03-18T05:50:16.1478836Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr: Analyzing
2020-03-18T05:50:16.8992059Z small slice      [no null in slice]/unrollled_wmemchr
2020-03-18T05:50:16.8992373Z                         time:   [133.59 ns 134.98 ns 136.48 ns]
2020-03-18T05:50:16.8992511Z Found 4 outliers among 100 measurements (4.00%)
2020-03-18T05:50:16.8992630Z   3 (3.00%) high mild
2020-03-18T05:50:16.8992742Z   1 (1.00%) high severe
2020-03-18T05:50:21.3025707Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr_iterative
2020-03-18T05:50:21.3026575Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-18T05:50:25.5922084Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0000 s (78M iterations)
2020-03-18T05:50:30.8066122Z Benchmarking small slice      [no null in slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-18T05:50:31.6337748Z small slice      [no null in slice]/unrollled_wmemchr_iterative
2020-03-18T05:50:31.6338121Z                         time:   [66.055 ns 66.770 ns 67.487 ns]
2020-03-18T05:50:31.6338617Z Found 4 outliers among 100 measurements (4.00%)
2020-03-18T05:50:31.6338852Z   1 (1.00%) low mild
2020-03-18T05:50:31.6338996Z   3 (3.00%) high mild
2020-03-18T05:50:36.0750764Z
2020-03-18T05:50:36.0751882Z Benchmarking small slice      [null in the middle of slice]/iter::position
2020-03-18T05:50:36.0752274Z Benchmarking small slice      [null in the middle of slice]/iter::position: Warming up for 3.0000 s
2020-03-18T05:50:39.3894833Z Benchmarking small slice      [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0002 s (51M iterations)
2020-03-18T05:50:44.4224006Z Benchmarking small slice      [null in the middle of slice]/iter::position: Analyzing
2020-03-18T05:50:45.2619311Z small slice      [null in the middle of slice]/iter::position
2020-03-18T05:50:45.2619708Z                         time:   [98.557 ns 99.526 ns 100.52 ns]
2020-03-18T05:50:45.2620068Z Found 1 outliers among 100 measurements (1.00%)
2020-03-18T05:50:45.2620334Z   1 (1.00%) high mild
2020-03-18T05:50:49.7667058Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr
2020-03-18T05:50:49.7667663Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-18T05:50:53.1912416Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0002 s (49M iterations)
2020-03-18T05:50:58.2077579Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr: Analyzing
2020-03-18T05:50:59.0254645Z small slice      [null in the middle of slice]/unrollled_wmemchr
2020-03-18T05:50:59.0256784Z                         time:   [101.29 ns 102.68 ns 104.12 ns]
2020-03-18T05:50:59.0257409Z Found 3 outliers among 100 measurements (3.00%)
2020-03-18T05:50:59.0257556Z   3 (3.00%) high mild
2020-03-18T05:51:03.3802118Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr_iterative
2020-03-18T05:51:03.3802767Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-18T05:51:06.5900109Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0002 s (105M iterations)
2020-03-18T05:51:11.6172165Z Benchmarking small slice      [null in the middle of slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-18T05:51:12.4356106Z small slice      [null in the middle of slice]/unrollled_wmemchr_iterative
2020-03-18T05:51:12.4356595Z                         time:   [47.360 ns 47.969 ns 48.613 ns]
2020-03-18T05:51:12.4357021Z Found 3 outliers among 100 measurements (3.00%)
2020-03-18T05:51:12.4357193Z   1 (1.00%) high mild
2020-03-18T05:51:12.4357333Z   2 (2.00%) high severe
2020-03-18T05:51:17.1443419Z
2020-03-18T05:51:17.1444526Z Benchmarking small slice      [null at the end of slice]/iter::position
2020-03-18T05:51:17.1445159Z Benchmarking small slice      [null at the end of slice]/iter::position: Warming up for 3.0000 s
2020-03-18T05:51:21.4481402Z Benchmarking small slice      [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.0004 s (39M iterations)
2020-03-18T05:51:26.5180527Z Benchmarking small slice      [null at the end of slice]/iter::position: Analyzing
2020-03-18T05:51:27.3675868Z small slice      [null at the end of slice]/iter::position
2020-03-18T05:51:27.3676880Z                         time:   [128.17 ns 129.58 ns 131.06 ns]
2020-03-18T05:51:27.3677040Z Found 6 outliers among 100 measurements (6.00%)
2020-03-18T05:51:27.3677137Z   5 (5.00%) high mild
2020-03-18T05:51:27.3677265Z   1 (1.00%) high severe
2020-03-18T05:51:31.7915187Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr
2020-03-18T05:51:31.7915888Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-18T05:51:36.6064361Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0005 s (35M iterations)
2020-03-18T05:51:41.5686771Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr: Analyzing
2020-03-18T05:51:42.3920117Z small slice      [null at the end of slice]/unrollled_wmemchr
2020-03-18T05:51:42.3920617Z                         time:   [140.50 ns 142.33 ns 144.24 ns]
2020-03-18T05:51:42.3920806Z Found 5 outliers among 100 measurements (5.00%)
2020-03-18T05:51:42.3920961Z   3 (3.00%) high mild
2020-03-18T05:51:42.3921089Z   2 (2.00%) high severe
2020-03-18T05:51:46.8215521Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr_iterative
2020-03-18T05:51:46.8216319Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-18T05:51:51.6645675Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0003 s (69M iterations)
2020-03-18T05:51:56.7271529Z Benchmarking small slice      [null at the end of slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-18T05:51:57.5354460Z small slice      [null at the end of slice]/unrollled_wmemchr_iterative
2020-03-18T05:51:57.5354992Z                         time:   [72.050 ns 73.008 ns 74.061 ns]
2020-03-18T05:51:57.5355157Z Found 3 outliers among 100 measurements (3.00%)
2020-03-18T05:51:57.5355320Z   3 (3.00%) high mild
2020-03-18T05:52:02.1146437Z
2020-03-18T05:52:02.1168515Z Benchmarking [medium slice    [no null in slice]/iter::position
2020-03-18T05:52:02.1169004Z Benchmarking [medium slice    [no null in slice]/iter::position: Warming up for 3.0000 s
2020-03-18T05:52:06.1506343Z Benchmarking [medium slice    [no null in slice]/iter::position: Collecting 100 samples in estimated 5.1278 s (167k iterations)
2020-03-18T05:52:11.4823652Z Benchmarking [medium slice    [no null in slice]/iter::position: Analyzing
2020-03-18T05:52:12.2204233Z [medium slice    [no null in slice]/iter::position
2020-03-18T05:52:12.2204838Z                         time:   [31.547 us 31.920 us 32.323 us]
2020-03-18T05:52:12.2204997Z Found 5 outliers among 100 measurements (5.00%)
2020-03-18T05:52:12.2205143Z   4 (4.00%) high mild
2020-03-18T05:52:12.2205272Z   1 (1.00%) high severe
2020-03-18T05:52:16.8041557Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr
2020-03-18T05:52:16.8042218Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-18T05:52:21.2426399Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.1295 s (152k iterations)
2020-03-18T05:52:26.5151744Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr: Analyzing
2020-03-18T05:52:27.3052828Z [medium slice    [no null in slice]/unrollled_wmemchr
2020-03-18T05:52:27.3053470Z                         time:   [34.395 us 34.858 us 35.363 us]
2020-03-18T05:52:27.3053627Z Found 2 outliers among 100 measurements (2.00%)
2020-03-18T05:52:27.3054001Z   2 (2.00%) high mild
2020-03-18T05:52:31.5657978Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr_iterative
2020-03-18T05:52:31.5658649Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-18T05:52:35.5142025Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0196 s (333k iterations)
2020-03-18T05:52:40.2825240Z Benchmarking [medium slice    [no null in slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-18T05:52:40.8901857Z [medium slice    [no null in slice]/unrollled_wmemchr_iterative
2020-03-18T05:52:40.8902446Z                         time:   [13.649 us 13.830 us 14.018 us]
2020-03-18T05:52:40.8902752Z Found 3 outliers among 100 measurements (3.00%)
2020-03-18T05:52:40.8903035Z   3 (3.00%) high mild
2020-03-18T05:52:45.4819242Z
2020-03-18T05:52:45.4845647Z Benchmarking medium slice     [null in the middle of slice]/iter::position
2020-03-18T05:52:45.4846223Z Benchmarking medium slice     [null in the middle of slice]/iter::position: Warming up for 3.0000 s
2020-03-18T05:52:51.5648968Z Benchmarking medium slice     [null in the middle of slice]/iter::position: Collecting 100 samples in estimated 5.0362 s (217k iterations)
2020-03-18T05:52:56.5782757Z Benchmarking medium slice     [null in the middle of slice]/iter::position: Analyzing
2020-03-18T05:52:57.3799057Z medium slice     [null in the middle of slice]/iter::position
2020-03-18T05:52:57.3799528Z                         time:   [22.458 us 22.821 us 23.195 us]
2020-03-18T05:52:57.3799672Z Found 9 outliers among 100 measurements (9.00%)
2020-03-18T05:52:57.3799792Z   2 (2.00%) low mild
2020-03-18T05:52:57.3799868Z   3 (3.00%) high mild
2020-03-18T05:52:57.3799986Z   4 (4.00%) high severe
2020-03-18T05:53:01.7676653Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr
2020-03-18T05:53:01.7677381Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-18T05:53:04.9054145Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.0770 s (212k iterations)
2020-03-18T05:53:09.7613923Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr: Analyzing
2020-03-18T05:53:10.4492342Z medium slice     [null in the middle of slice]/unrollled_wmemchr
2020-03-18T05:53:10.4492806Z                         time:   [22.539 us 22.852 us 23.193 us]
2020-03-18T05:53:10.4492933Z Found 6 outliers among 100 measurements (6.00%)
2020-03-18T05:53:10.4493051Z   5 (5.00%) high mild
2020-03-18T05:53:10.4493330Z   1 (1.00%) high severe
2020-03-18T05:53:14.5165157Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative
2020-03-18T05:53:14.5165630Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-18T05:53:20.1152218Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0147 s (470k iterations)
2020-03-18T05:53:25.1171883Z Benchmarking medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-18T05:53:25.8865083Z medium slice     [null in the middle of slice]/unrollled_wmemchr_iterative
2020-03-18T05:53:25.8865451Z                         time:   [10.457 us 10.626 us 10.807 us]
2020-03-18T05:53:30.0334728Z
2020-03-18T05:53:30.0357746Z Benchmarking medium slice     [null at the end of slice]/iter::position
2020-03-18T05:53:30.0366730Z Benchmarking medium slice     [null at the end of slice]/iter::position: Warming up for 3.0000 s
2020-03-18T05:53:34.0575997Z Benchmarking medium slice     [null at the end of slice]/iter::position: Collecting 100 samples in estimated 5.1130 s (167k iterations)
2020-03-18T05:53:38.9697693Z Benchmarking medium slice     [null at the end of slice]/iter::position: Analyzing
2020-03-18T05:53:39.7709618Z medium slice     [null at the end of slice]/iter::position
2020-03-18T05:53:39.7709928Z                         time:   [28.618 us 29.321 us 30.079 us]
2020-03-18T05:53:39.7710085Z Found 2 outliers among 100 measurements (2.00%)
2020-03-18T05:53:39.7710220Z   1 (1.00%) high mild
2020-03-18T05:53:39.7710350Z   1 (1.00%) high severe
2020-03-18T05:53:44.4006636Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr
2020-03-18T05:53:44.4007548Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr: Warming up for 3.0000 s
2020-03-18T05:53:48.9921709Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr: Collecting 100 samples in estimated 5.1296 s (146k iterations)
2020-03-18T05:53:54.0691553Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr: Analyzing
2020-03-18T05:53:54.8883262Z medium slice     [null at the end of slice]/unrollled_wmemchr
2020-03-18T05:53:54.8883788Z                         time:   [33.817 us 34.470 us 35.135 us]
2020-03-18T05:53:54.8883977Z Found 7 outliers among 100 measurements (7.00%)
2020-03-18T05:53:54.8884131Z   5 (5.00%) high mild
2020-03-18T05:53:54.8884265Z   2 (2.00%) high severe
2020-03-18T05:53:59.4650270Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr_iterative
2020-03-18T05:53:59.4651021Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr_iterative: Warming up for 3.0000 s
2020-03-18T05:54:03.5180601Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr_iterative: Collecting 100 samples in estimated 5.0745 s (328k iterations)
2020-03-18T05:54:08.7953646Z Benchmarking medium slice     [null at the end of slice]/unrollled_wmemchr_iterative: Analyzing
2020-03-18T05:54:09.6085135Z medium slice     [null at the end of slice]/unrollled_wmemchr_iterative
2020-03-18T05:54:09.6085531Z                         time:   [15.771 us 15.986 us 16.194 us]
2020-03-18T05:54:09.6085712Z Found 6 outliers among 100 measurements (6.00%)
2020-03-18T05:54:09.6085904Z   3 (3.00%) high mild
2020-03-18T05:54:09.6086052Z   3 (3.00%) high severe
2020-03-18T05:54:14.1367706Z

@wesleywiser
Copy link
Member

Sorry for the delay on this!

@bors r+

@bors
Copy link
Contributor

bors commented Apr 7, 2020

📌 Commit 89bc236 has been approved by wesleywiser

@bors
Copy link
Contributor

bors commented Apr 7, 2020

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 7, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 9, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#67705 (Use unrolled loop for searching NULL in [u16] on Windows)
 - rust-lang#70367 (save/restore `pessimistic_yield` when entering bodies)
 - rust-lang#70822 (Don't lint for self-recursion when the function can diverge)
 - rust-lang#70868 (rustc_codegen_ssa: Refactor construction of linker arguments)
 - rust-lang#70896 (Implement Chain with Option fuses)
 - rust-lang#70916 (Support `#[track_caller]` on functions in `extern "Rust" { ... }`)
 - rust-lang#70918 (rustc_session: forbid lints override regardless of position)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Apr 9, 2020

☔ The latest upstream changes (presumably #70943) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2020
@bors bors merged commit e89cb07 into rust-lang:master Apr 9, 2020
@tesuji tesuji deleted the wmemchr branch April 9, 2020 13:23
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 8, 2020
Remove some redundant parts from `unrolled_find_u16s`

See each commit message for details.

r? @wesleywiser from old PR rust-lang#67705 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet