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

buffer: allow Uint8Array input to methods #10236

Closed
wants to merge 3 commits into from

Conversation

addaleax
Copy link
Member

@addaleax addaleax commented Dec 12, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

buffer

Description of change

Allow all methods on buffer and Buffer to take Uint8Array
arguments where it makes sense. On the native side, there is
effectively no difference, and as a bonus the isUint8Array
check is faster than instanceof Buffer.

Benchmark results @ https://gist.github.com/addaleax/8544e43f7d28a58d032944137afeabf4, summary in this fold
                                                                                                                                                improvement significant      p.value
 buffers/buffer-base64-decode.js                                                                                                                     0.33 %             4.989959e-01
 buffers/buffer-base64-encode.js                                                                                                                    -0.26 %             5.876859e-01
 buffers/buffer-bytelength.js n=5000000 len=16 encoding="base64"                                                                                    -0.20 %             5.174388e-01
 buffers/buffer-bytelength.js n=5000000 len=16 encoding="utf8"                                                                                      -0.18 %             4.589270e-01
 buffers/buffer-bytelength.js n=5000000 len=1 encoding="base64"                                                                                     -0.49 %           * 4.083862e-02
 buffers/buffer-bytelength.js n=5000000 len=1 encoding="utf8"                                                                                       -0.25 %             5.226933e-01
 buffers/buffer-bytelength.js n=5000000 len=256 encoding="base64"                                                                                   -0.15 %             5.624977e-01
 buffers/buffer-bytelength.js n=5000000 len=256 encoding="utf8"                                                                                     -0.35 %             8.081021e-02
 buffers/buffer-bytelength.js n=5000000 len=2 encoding="base64"                                                                                     -0.34 %             1.541680e-01
 buffers/buffer-bytelength.js n=5000000 len=2 encoding="utf8"                                                                                        0.12 %             7.371437e-01
 buffers/buffer-bytelength.js n=5000000 len=4 encoding="base64"                                                                                     -0.05 %             8.371398e-01
 buffers/buffer-bytelength.js n=5000000 len=4 encoding="utf8"                                                                                       -0.07 %             7.692104e-01
 buffers/buffer-bytelength.js n=5000000 len=64 encoding="base64"                                                                                     0.03 %             9.289804e-01
 buffers/buffer-bytelength.js n=5000000 len=64 encoding="utf8"                                                                                      -0.44 %           * 3.595639e-02
 buffers/buffer-compare-instance-method.js millions=1 size=1024                                                                                     38.15 %         *** 1.382193e-32
 buffers/buffer-compare-instance-method.js millions=1 size=16                                                                                       44.75 %         *** 3.403819e-46
 buffers/buffer-compare-instance-method.js millions=1 size=16386                                                                                    12.41 %         *** 1.417884e-39
 buffers/buffer-compare-instance-method.js millions=1 size=4096                                                                                     25.77 %         *** 3.522730e-44
 buffers/buffer-compare-instance-method.js millions=1 size=512                                                                                      40.13 %         *** 5.512553e-39
 buffers/buffer-compare.js millions=1 size=1024                                                                                                    126.83 %         *** 6.571906e-30
 buffers/buffer-compare.js millions=1 size=16                                                                                                      163.95 %         *** 1.334774e-26
 buffers/buffer-compare.js millions=1 size=16386                                                                                                    37.60 %         *** 3.589380e-43
 buffers/buffer-compare.js millions=1 size=4096                                                                                                     72.93 %         *** 5.148946e-28
 buffers/buffer-compare.js millions=1 size=512                                                                                                     141.11 %         *** 2.765525e-29
 buffers/buffer-compare-offset.js millions=1 size=1024 method="offset"                                                                              30.32 %         *** 1.178404e-20
 buffers/buffer-compare-offset.js millions=1 size=1024 method="slice"                                                                               45.20 %         *** 5.328128e-28
 buffers/buffer-compare-offset.js millions=1 size=16386 method="offset"                                                                             29.29 %         *** 1.009668e-20
 buffers/buffer-compare-offset.js millions=1 size=16386 method="slice"                                                                              46.57 %         *** 1.386654e-36
 buffers/buffer-compare-offset.js millions=1 size=16 method="offset"                                                                                28.85 %         *** 1.740339e-20
 buffers/buffer-compare-offset.js millions=1 size=16 method="slice"                                                                                 44.83 %         *** 1.334218e-31
 buffers/buffer-compare-offset.js millions=1 size=4096 method="offset"                                                                              29.05 %         *** 2.917765e-22
 buffers/buffer-compare-offset.js millions=1 size=4096 method="slice"                                                                               46.51 %         *** 7.264692e-30
 buffers/buffer-compare-offset.js millions=1 size=512 method="offset"                                                                               30.08 %         *** 1.155313e-21
 buffers/buffer-compare-offset.js millions=1 size=512 method="slice"                                                                                44.78 %         *** 5.072915e-25
 buffers/buffer-concat.js n=1024 withTotalLength=0 pieceSize=16 pieces=1                                                                            49.81 %         *** 5.031896e-22
 buffers/buffer-concat.js n=1024 withTotalLength=0 pieceSize=16 pieces=16                                                                          111.19 %         *** 2.691135e-59
 buffers/buffer-concat.js n=1024 withTotalLength=0 pieceSize=16 pieces=4                                                                            98.56 %         *** 3.904044e-58
 buffers/buffer-concat.js n=1024 withTotalLength=0 pieceSize=1 pieces=1                                                                             51.69 %         *** 1.519463e-20
 buffers/buffer-concat.js n=1024 withTotalLength=0 pieceSize=1 pieces=16                                                                            92.09 %         *** 1.172069e-28
 buffers/buffer-concat.js n=1024 withTotalLength=0 pieceSize=1 pieces=4                                                                            102.19 %         *** 7.590241e-50
 buffers/buffer-concat.js n=1024 withTotalLength=0 pieceSize=256 pieces=1                                                                           62.38 %         *** 7.799720e-58
 buffers/buffer-concat.js n=1024 withTotalLength=0 pieceSize=256 pieces=16                                                                          72.91 %         *** 2.967023e-28
 buffers/buffer-concat.js n=1024 withTotalLength=0 pieceSize=256 pieces=4                                                                           70.28 %         *** 1.308737e-57
 buffers/buffer-concat.js n=1024 withTotalLength=1 pieceSize=16 pieces=1                                                                            67.29 %         *** 2.724615e-25
 buffers/buffer-concat.js n=1024 withTotalLength=1 pieceSize=16 pieces=16                                                                          113.38 %         *** 1.476974e-66
 buffers/buffer-concat.js n=1024 withTotalLength=1 pieceSize=16 pieces=4                                                                            88.43 %         *** 2.203940e-73
 buffers/buffer-concat.js n=1024 withTotalLength=1 pieceSize=1 pieces=1                                                                             60.37 %         *** 3.169333e-19
 buffers/buffer-concat.js n=1024 withTotalLength=1 pieceSize=1 pieces=16                                                                           103.32 %         *** 3.286131e-27
 buffers/buffer-concat.js n=1024 withTotalLength=1 pieceSize=1 pieces=4                                                                             97.04 %         *** 1.985550e-37
 buffers/buffer-concat.js n=1024 withTotalLength=1 pieceSize=256 pieces=1                                                                           60.69 %         *** 2.728163e-37
 buffers/buffer-concat.js n=1024 withTotalLength=1 pieceSize=256 pieces=16                                                                          71.44 %         *** 7.853933e-59
 buffers/buffer-concat.js n=1024 withTotalLength=1 pieceSize=256 pieces=4                                                                           71.37 %         *** 7.135345e-72
 buffers/buffer-creation.js n=1024 len=1024 type="buffer()"                                                                                          0.87 %          ** 6.959919e-03
 buffers/buffer-creation.js n=1024 len=1024 type="fast-alloc"                                                                                        0.47 %             4.485933e-01
 buffers/buffer-creation.js n=1024 len=1024 type="fast-alloc-fill"                                                                                   0.42 %             6.658288e-01
 buffers/buffer-creation.js n=1024 len=1024 type="fast-allocUnsafe"                                                                                 -0.05 %             9.182350e-01
 buffers/buffer-creation.js n=1024 len=1024 type="slow"                                                                                             -1.23 %           * 2.932270e-02
 buffers/buffer-creation.js n=1024 len=1024 type="slow-allocUnsafe"                                                                                  0.23 %             5.926413e-01
 buffers/buffer-creation.js n=1024 len=10 type="buffer()"                                                                                            0.01 %             9.797165e-01
 buffers/buffer-creation.js n=1024 len=10 type="fast-alloc"                                                                                         -4.74 %          ** 5.295541e-03
 buffers/buffer-creation.js n=1024 len=10 type="fast-alloc-fill"                                                                                    -1.58 %             3.609361e-01
 buffers/buffer-creation.js n=1024 len=10 type="fast-allocUnsafe"                                                                                   -0.70 %             5.293258e-01
 buffers/buffer-creation.js n=1024 len=10 type="slow"                                                                                                1.89 %             1.437426e-01
 buffers/buffer-creation.js n=1024 len=10 type="slow-allocUnsafe"                                                                                   -1.37 %             1.110352e-01
 buffers/buffer-creation.js n=1024 len=2048 type="buffer()"                                                                                          0.77 %           * 4.952968e-02
 buffers/buffer-creation.js n=1024 len=2048 type="fast-alloc"                                                                                        0.73 %             1.672748e-01
 buffers/buffer-creation.js n=1024 len=2048 type="fast-alloc-fill"                                                                                   0.10 %             9.052038e-01
 buffers/buffer-creation.js n=1024 len=2048 type="fast-allocUnsafe"                                                                                 -1.41 %          ** 6.444248e-03
 buffers/buffer-creation.js n=1024 len=2048 type="slow"                                                                                             -1.20 %           * 1.895756e-02
 buffers/buffer-creation.js n=1024 len=2048 type="slow-allocUnsafe"                                                                                  3.07 %         *** 2.875319e-06
 buffers/buffer-creation.js n=1024 len=4096 type="buffer()"                                                                                          2.24 %         *** 1.447597e-04
 buffers/buffer-creation.js n=1024 len=4096 type="fast-alloc"                                                                                        0.91 %           * 3.618377e-02
 buffers/buffer-creation.js n=1024 len=4096 type="fast-alloc-fill"                                                                                   0.68 %             3.480161e-01
 buffers/buffer-creation.js n=1024 len=4096 type="fast-allocUnsafe"                                                                                  2.68 %         *** 5.731177e-07
 buffers/buffer-creation.js n=1024 len=4096 type="slow"                                                                                             -2.03 %         *** 4.498264e-05
 buffers/buffer-creation.js n=1024 len=4096 type="slow-allocUnsafe"                                                                                  3.62 %         *** 3.112713e-08
 buffers/buffer-creation.js n=1024 len=8192 type="buffer()"                                                                                          2.31 %         *** 5.904463e-04
 buffers/buffer-creation.js n=1024 len=8192 type="fast-alloc"                                                                                        0.21 %             3.679837e-01
 buffers/buffer-creation.js n=1024 len=8192 type="fast-alloc-fill"                                                                                   0.83 %             1.359332e-01
 buffers/buffer-creation.js n=1024 len=8192 type="fast-allocUnsafe"                                                                                  1.46 %           * 3.465755e-02
 buffers/buffer-creation.js n=1024 len=8192 type="slow"                                                                                             -1.73 %          ** 1.660347e-03
 buffers/buffer-creation.js n=1024 len=8192 type="slow-allocUnsafe"                                                                                  2.00 %          ** 3.660894e-03
 buffers/buffer-from.js n=1024 len=10 source="array"                                                                                                55.19 %         *** 5.065928e-31
 buffers/buffer-from.js n=1024 len=10 source="arraybuffer"                                                                                          -0.48 %             2.372293e-01
 buffers/buffer-from.js n=1024 len=10 source="arraybuffer-middle"                                                                                    1.71 %             6.434012e-02
 buffers/buffer-from.js n=1024 len=10 source="buffer"                                                                                               30.59 %         *** 2.622430e-37
 buffers/buffer-from.js n=1024 len=10 source="string"                                                                                                6.64 %         *** 6.883215e-23
 buffers/buffer-from.js n=1024 len=10 source="string-base64"                                                                                         0.33 %             8.266461e-01
 buffers/buffer-from.js n=1024 len=10 source="uint8array"                                                                                           29.09 %         *** 5.380573e-32
 buffers/buffer-from.js n=1024 len=2048 source="array"                                                                                              15.98 %         *** 3.981186e-44
 buffers/buffer-from.js n=1024 len=2048 source="arraybuffer"                                                                                        -0.94 %           * 1.263886e-02
 buffers/buffer-from.js n=1024 len=2048 source="arraybuffer-middle"                                                                                  2.89 %          ** 9.615152e-03
 buffers/buffer-from.js n=1024 len=2048 source="buffer"                                                                                             11.49 %         *** 9.369552e-20
 buffers/buffer-from.js n=1024 len=2048 source="string"                                                                                              0.45 %             3.291592e-01
 buffers/buffer-from.js n=1024 len=2048 source="string-base64"                                                                                       0.27 %             3.604900e-01
 buffers/buffer-from.js n=1024 len=2048 source="uint8array"                                                                                        342.32 %         *** 1.908472e-47
 buffers/buffer-hex.js n=10000000 len=0                                                                                                              1.05 %             2.726122e-01
 buffers/buffer-hex.js n=10000000 len=1                                                                                                             -9.76 %         *** 2.185367e-13
 buffers/buffer-hex.js n=10000000 len=1024                                                                                                          -2.51 %         *** 2.097545e-08
 buffers/buffer-hex.js n=10000000 len=64                                                                                                           -10.71 %         *** 2.358060e-10
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="@"                                                                        37.20 %         *** 3.542962e-22
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="10x"                                                                      33.68 %         *** 9.223620e-23
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="aaaaaaaaaaaaaaaaa"                                                         0.42 %             1.207794e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="Alice"                                                                    48.93 %         *** 2.565451e-25
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="among mad people"                                                          0.50 %           * 3.892363e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="found it very"                                                             0.85 %           * 2.219407e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="Gryphon"                                                                   3.50 %         *** 8.674603e-04
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search=" to the Caterpillar"                                                   0.31 %             3.459151e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="--l"                                                                       1.98 %           * 1.021171e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="neighbouring pool"                                                         0.44 %             7.150775e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="Ou est ma chatte?"                                                         1.07 %           * 1.871304e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="Panther"                                                                   2.82 %          ** 2.464515e-03
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="Soo--oop"                                                                 -0.20 %             5.386833e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="SQ"                                                                        8.99 %         *** 1.787493e-07
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="binary" search="venture to go near the house till she had brought herself down to"         0.62 %             2.115197e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="@"                                                                          37.58 %         *** 2.771259e-23
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="10x"                                                                        29.75 %         *** 4.610992e-36
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="aaaaaaaaaaaaaaaaa"                                                           0.77 %           * 2.557371e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="Alice"                                                                      60.62 %         *** 1.165571e-34
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="among mad people"                                                            1.00 %          ** 1.430622e-03
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="found it very"                                                               2.06 %         *** 1.037499e-06
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="Gryphon"                                                                     6.38 %         *** 3.858636e-12
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search=" to the Caterpillar"                                                     1.52 %         *** 9.562553e-04
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="--l"                                                                         3.35 %         *** 3.924503e-07
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="neighbouring pool"                                                           0.90 %          ** 1.032536e-03
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="Ou est ma chatte?"                                                           1.26 %         *** 1.349364e-04
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="Panther"                                                                     5.16 %         *** 5.009852e-06
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="Soo--oop"                                                                    0.46 %             1.317764e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="SQ"                                                                          5.53 %         *** 8.890122e-09
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="ucs2" search="venture to go near the house till she had brought herself down to"           0.59 %             2.490438e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="@"                                                                     40.38 %         *** 1.063174e-23
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="10x"                                                                   27.50 %         *** 1.220782e-30
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="aaaaaaaaaaaaaaaaa"                                                     -0.11 %             6.967607e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="Alice"                                                                 54.55 %         *** 1.085650e-28
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="among mad people"                                                       0.72 %             6.064134e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="found it very"                                                          0.96 %          ** 3.682646e-03
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="Gryphon"                                                                3.08 %         *** 8.846503e-04
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search=" to the Caterpillar"                                                0.19 %             5.083242e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="--l"                                                                    1.37 %           * 4.984706e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="neighbouring pool"                                                      0.39 %             1.678855e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="Ou est ma chatte?"                                                      1.86 %         *** 2.286411e-06
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="Panther"                                                                1.95 %         *** 1.392627e-05
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="Soo--oop"                                                               0.11 %             6.461592e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="SQ"                                                                     7.02 %         *** 3.549004e-19
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="undefined" search="venture to go near the house till she had brought herself down to"      0.90 %          ** 3.560083e-03
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="@"                                                                          45.28 %         *** 7.671655e-31
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="10x"                                                                        34.74 %         *** 1.102241e-26
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="aaaaaaaaaaaaaaaaa"                                                           0.17 %             5.713185e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="Alice"                                                                      58.26 %         *** 3.450525e-23
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="among mad people"                                                            0.87 %         *** 2.266250e-04
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="found it very"                                                               0.77 %           * 2.560822e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="Gryphon"                                                                     3.61 %         *** 6.593369e-05
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search=" to the Caterpillar"                                                     0.15 %             6.481659e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="--l"                                                                         2.77 %         *** 1.076342e-04
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="neighbouring pool"                                                           0.47 %           * 4.559572e-02
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="Ou est ma chatte?"                                                           1.69 %          ** 1.514151e-03
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="Panther"                                                                     1.70 %             1.705668e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="Soo--oop"                                                                    0.22 %             3.613165e-01
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="SQ"                                                                         10.58 %         *** 4.929414e-23
 buffers/buffer-indexof.js iter=1 type="buffer" encoding="utf8" search="venture to go near the house till she had brought herself down to"           0.86 %           * 4.773720e-02
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="@"                                                                         7.79 %         *** 6.007483e-04
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="10x"                                                                       3.96 %           * 2.108940e-02
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="aaaaaaaaaaaaaaaaa"                                                         0.03 %             9.097698e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="Alice"                                                                     6.38 %         *** 5.662132e-04
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="among mad people"                                                          0.24 %             3.256649e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="found it very"                                                             0.26 %             4.113980e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="Gryphon"                                                                   0.44 %             4.888076e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search=" to the Caterpillar"                                                   0.00 %             9.939394e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="--l"                                                                       1.09 %             1.249109e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="neighbouring pool"                                                         0.03 %             8.908611e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="Ou est ma chatte?"                                                        -0.43 %             3.184906e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="Panther"                                                                   1.35 %             1.549085e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="Soo--oop"                                                                 -0.46 %             1.376180e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="SQ"                                                                        1.31 %             7.418987e-02
 buffers/buffer-indexof.js iter=1 type="string" encoding="binary" search="venture to go near the house till she had brought herself down to"        -0.06 %             8.878934e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="@"                                                                           1.22 %             4.890280e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="10x"                                                                         2.12 %             2.727112e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="aaaaaaaaaaaaaaaaa"                                                          -0.40 %             1.965634e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="Alice"                                                                       4.10 %             6.921701e-02
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="among mad people"                                                           -0.19 %             4.302989e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="found it very"                                                               0.60 %             1.002569e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="Gryphon"                                                                     0.92 %             4.072588e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search=" to the Caterpillar"                                                    -0.31 %             4.103261e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="--l"                                                                        -0.29 %             7.447259e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="neighbouring pool"                                                          -0.05 %             8.292093e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="Ou est ma chatte?"                                                          -0.08 %             8.313699e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="Panther"                                                                     0.12 %             8.148198e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="Soo--oop"                                                                   -0.22 %             3.934738e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="SQ"                                                                         -0.32 %             6.100616e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="ucs2" search="venture to go near the house till she had brought herself down to"           0.18 %             6.725420e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="@"                                                                     -0.26 %             8.940796e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="10x"                                                                   -0.97 %             1.943054e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="aaaaaaaaaaaaaaaaa"                                                     -0.39 %             1.938172e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="Alice"                                                                 -0.62 %             7.623900e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="among mad people"                                                       0.37 %             2.565950e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="found it very"                                                          0.45 %             1.646049e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="Gryphon"                                                                0.77 %             1.909406e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search=" to the Caterpillar"                                               -0.38 %             2.535046e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="--l"                                                                    0.21 %             7.001069e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="neighbouring pool"                                                     -0.18 %             5.153790e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="Ou est ma chatte?"                                                      0.31 %             4.755964e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="Panther"                                                                1.53 %             2.057011e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="Soo--oop"                                                              -0.24 %             3.253246e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="SQ"                                                                     1.09 %             3.126744e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="undefined" search="venture to go near the house till she had brought herself down to"     -0.17 %             5.848739e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="@"                                                                           2.78 %             1.453905e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="10x"                                                                         2.09 %          ** 8.082158e-03
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="aaaaaaaaaaaaaaaaa"                                                          -0.47 %             1.367428e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="Alice"                                                                       3.16 %             7.106134e-02
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="among mad people"                                                            0.19 %             4.273365e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="found it very"                                                               0.31 %             3.456479e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="Gryphon"                                                                     1.11 %             1.577975e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search=" to the Caterpillar"                                                    -0.64 %             6.861593e-02
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="--l"                                                                         0.35 %             6.612087e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="neighbouring pool"                                                          -0.01 %             9.573545e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="Ou est ma chatte?"                                                          -0.45 %             4.094150e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="Panther"                                                                     0.16 %             8.239952e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="Soo--oop"                                                                   -0.19 %             4.129859e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="SQ"                                                                          0.26 %             6.263002e-01
 buffers/buffer-indexof.js iter=1 type="string" encoding="utf8" search="venture to go near the house till she had brought herself down to"           0.05 %             9.158092e-01
 buffers/buffer-iterate.js n=1000 method="forOf" type="fast" size=1024                                                                              -0.32 %             5.759045e-01
 buffers/buffer-iterate.js n=1000 method="forOf" type="fast" size=16                                                                                 2.91 %             2.662040e-01
 buffers/buffer-iterate.js n=1000 method="forOf" type="fast" size=16386                                                                              0.37 %             1.365537e-01
 buffers/buffer-iterate.js n=1000 method="forOf" type="fast" size=4096                                                                               0.84 %          ** 7.140241e-03
 buffers/buffer-iterate.js n=1000 method="forOf" type="fast" size=512                                                                                0.84 %             1.557964e-01
 buffers/buffer-iterate.js n=1000 method="forOf" type="slow" size=1024                                                                               0.25 %             5.888459e-01
 buffers/buffer-iterate.js n=1000 method="forOf" type="slow" size=16                                                                                 1.46 %             5.094230e-01
 buffers/buffer-iterate.js n=1000 method="forOf" type="slow" size=16386                                                                              0.30 %             3.086731e-01
 buffers/buffer-iterate.js n=1000 method="forOf" type="slow" size=4096                                                                               0.20 %             5.843111e-01
 buffers/buffer-iterate.js n=1000 method="forOf" type="slow" size=512                                                                                0.70 %             2.853516e-01
 buffers/buffer-iterate.js n=1000 method="for" type="fast" size=1024                                                                                -0.79 %             7.844882e-01
 buffers/buffer-iterate.js n=1000 method="for" type="fast" size=16                                                                                   4.70 %             2.226158e-01
 buffers/buffer-iterate.js n=1000 method="for" type="fast" size=16386                                                                                1.01 %             5.769187e-02
 buffers/buffer-iterate.js n=1000 method="for" type="fast" size=4096                                                                                 0.89 %             6.311505e-01
 buffers/buffer-iterate.js n=1000 method="for" type="fast" size=512                                                                                 -3.59 %             2.518263e-01
 buffers/buffer-iterate.js n=1000 method="for" type="slow" size=1024                                                                                 3.17 %             2.904156e-01
 buffers/buffer-iterate.js n=1000 method="for" type="slow" size=16                                                                                   3.27 %             3.286491e-01
 buffers/buffer-iterate.js n=1000 method="for" type="slow" size=16386                                                                                0.90 %             2.002919e-01
 buffers/buffer-iterate.js n=1000 method="for" type="slow" size=4096                                                                                 0.57 %             6.115540e-01
 buffers/buffer-iterate.js n=1000 method="for" type="slow" size=512                                                                                  6.18 %             6.398091e-02
 buffers/buffer-iterate.js n=1000 method="iterator" type="fast" size=1024                                                                           -0.20 %             7.048810e-01
 buffers/buffer-iterate.js n=1000 method="iterator" type="fast" size=16                                                                              0.48 %             8.618237e-01
 buffers/buffer-iterate.js n=1000 method="iterator" type="fast" size=16386                                                                          -0.04 %             9.079813e-01
 buffers/buffer-iterate.js n=1000 method="iterator" type="fast" size=4096                                                                           -0.31 %             4.943081e-01
 buffers/buffer-iterate.js n=1000 method="iterator" type="fast" size=512                                                                             1.04 %             3.204352e-01
 buffers/buffer-iterate.js n=1000 method="iterator" type="slow" size=1024                                                                            1.17 %             1.901865e-01
 buffers/buffer-iterate.js n=1000 method="iterator" type="slow" size=16                                                                              3.42 %             2.490876e-01
 buffers/buffer-iterate.js n=1000 method="iterator" type="slow" size=16386                                                                           0.23 %             4.129062e-01
 buffers/buffer-iterate.js n=1000 method="iterator" type="slow" size=4096                                                                           -0.03 %             9.316435e-01
 buffers/buffer-iterate.js n=1000 method="iterator" type="slow" size=512                                                                            -0.04 %             9.589368e-01
 buffers/buffer-read.js millions=1 type="DoubleBE" buffer="fast" noAssert="false"                                                                   -0.07 %             9.034292e-01
 buffers/buffer-read.js millions=1 type="DoubleBE" buffer="fast" noAssert="true"                                                                    -0.89 %             5.164235e-02
 buffers/buffer-read.js millions=1 type="DoubleBE" buffer="slow" noAssert="false"                                                                   -0.02 %             9.588723e-01
 buffers/buffer-read.js millions=1 type="DoubleBE" buffer="slow" noAssert="true"                                                                    -0.31 %             5.722770e-01
 buffers/buffer-read.js millions=1 type="DoubleLE" buffer="fast" noAssert="false"                                                                    0.50 %             4.147880e-01
 buffers/buffer-read.js millions=1 type="DoubleLE" buffer="fast" noAssert="true"                                                                     0.48 %             3.999456e-01
 buffers/buffer-read.js millions=1 type="DoubleLE" buffer="slow" noAssert="false"                                                                   -0.29 %             5.647489e-01
 buffers/buffer-read.js millions=1 type="DoubleLE" buffer="slow" noAssert="true"                                                                    -0.96 %             8.664769e-02
 buffers/buffer-read.js millions=1 type="FloatBE" buffer="fast" noAssert="false"                                                                     0.11 %             8.196798e-01
 buffers/buffer-read.js millions=1 type="FloatBE" buffer="fast" noAssert="true"                                                                     -0.00 %             9.962163e-01
 buffers/buffer-read.js millions=1 type="FloatBE" buffer="slow" noAssert="false"                                                                    -0.68 %             1.965449e-01
 buffers/buffer-read.js millions=1 type="FloatBE" buffer="slow" noAssert="true"                                                                      0.55 %             2.704413e-01
 buffers/buffer-read.js millions=1 type="FloatLE" buffer="fast" noAssert="false"                                                                     0.31 %             5.137215e-01
 buffers/buffer-read.js millions=1 type="FloatLE" buffer="fast" noAssert="true"                                                                      0.48 %             3.759505e-01
 buffers/buffer-read.js millions=1 type="FloatLE" buffer="slow" noAssert="false"                                                                    -0.81 %             1.987916e-01
 buffers/buffer-read.js millions=1 type="FloatLE" buffer="slow" noAssert="true"                                                                      0.85 %             8.764929e-02
 buffers/buffer-read.js millions=1 type="Int16BE" buffer="fast" noAssert="false"                                                                     0.04 %             9.809148e-01
 buffers/buffer-read.js millions=1 type="Int16BE" buffer="fast" noAssert="true"                                                                     -0.95 %             7.730131e-01
 buffers/buffer-read.js millions=1 type="Int16BE" buffer="slow" noAssert="false"                                                                     2.04 %             2.846689e-01
 buffers/buffer-read.js millions=1 type="Int16BE" buffer="slow" noAssert="true"                                                                      3.70 %             2.529727e-01
 buffers/buffer-read.js millions=1 type="Int16LE" buffer="fast" noAssert="false"                                                                     0.43 %             8.606788e-01
 buffers/buffer-read.js millions=1 type="Int16LE" buffer="fast" noAssert="true"                                                                     -2.24 %             4.568986e-01
 buffers/buffer-read.js millions=1 type="Int16LE" buffer="slow" noAssert="false"                                                                     0.78 %             6.221753e-01
 buffers/buffer-read.js millions=1 type="Int16LE" buffer="slow" noAssert="true"                                                                      2.88 %             3.171275e-01
 buffers/buffer-read.js millions=1 type="Int32BE" buffer="fast" noAssert="false"                                                                     1.87 %             3.649463e-01
 buffers/buffer-read.js millions=1 type="Int32BE" buffer="fast" noAssert="true"                                                                     -3.02 %             3.445022e-01
 buffers/buffer-read.js millions=1 type="Int32BE" buffer="slow" noAssert="false"                                                                     0.68 %             6.931129e-01
 buffers/buffer-read.js millions=1 type="Int32BE" buffer="slow" noAssert="true"                                                                      1.47 %             6.275251e-01
 buffers/buffer-read.js millions=1 type="Int32LE" buffer="fast" noAssert="false"                                                                    -0.27 %             8.808924e-01
 buffers/buffer-read.js millions=1 type="Int32LE" buffer="fast" noAssert="true"                                                                     -3.66 %             2.600207e-01
 buffers/buffer-read.js millions=1 type="Int32LE" buffer="slow" noAssert="false"                                                                     2.55 %             2.293470e-01
 buffers/buffer-read.js millions=1 type="Int32LE" buffer="slow" noAssert="true"                                                                      1.10 %             7.144814e-01
 buffers/buffer-read.js millions=1 type="Int8" buffer="fast" noAssert="false"                                                                        0.87 %             7.422875e-01
 buffers/buffer-read.js millions=1 type="Int8" buffer="fast" noAssert="true"                                                                        -6.37 %             1.158750e-01
 buffers/buffer-read.js millions=1 type="Int8" buffer="slow" noAssert="false"                                                                        1.54 %             4.284394e-01
 buffers/buffer-read.js millions=1 type="Int8" buffer="slow" noAssert="true"                                                                       -10.09 %          ** 2.968315e-03
 buffers/buffer-read.js millions=1 type="UInt16BE" buffer="fast" noAssert="false"                                                                    7.51 %           * 3.077579e-02
 buffers/buffer-read.js millions=1 type="UInt16BE" buffer="fast" noAssert="true"                                                                     1.31 %             6.516420e-01
 buffers/buffer-read.js millions=1 type="UInt16BE" buffer="slow" noAssert="false"                                                                   -2.47 %             2.759382e-01
 buffers/buffer-read.js millions=1 type="UInt16BE" buffer="slow" noAssert="true"                                                                    -0.66 %             8.439004e-01
 buffers/buffer-read.js millions=1 type="UInt16LE" buffer="fast" noAssert="false"                                                                    2.17 %             5.190179e-01
 buffers/buffer-read.js millions=1 type="UInt16LE" buffer="fast" noAssert="true"                                                                     1.12 %             7.475412e-01
 buffers/buffer-read.js millions=1 type="UInt16LE" buffer="slow" noAssert="false"                                                                    2.44 %             3.112944e-01
 buffers/buffer-read.js millions=1 type="UInt16LE" buffer="slow" noAssert="true"                                                                     0.63 %             8.484462e-01
 buffers/buffer-read.js millions=1 type="UInt32BE" buffer="fast" noAssert="false"                                                                   -0.96 %             7.235121e-01
 buffers/buffer-read.js millions=1 type="UInt32BE" buffer="fast" noAssert="true"                                                                    -1.30 %             7.045360e-01
 buffers/buffer-read.js millions=1 type="UInt32BE" buffer="slow" noAssert="false"                                                                    0.19 %             9.027826e-01
 buffers/buffer-read.js millions=1 type="UInt32BE" buffer="slow" noAssert="true"                                                                    -0.43 %             8.775968e-01
 buffers/buffer-read.js millions=1 type="UInt32LE" buffer="fast" noAssert="false"                                                                   -1.45 %             6.537269e-01
 buffers/buffer-read.js millions=1 type="UInt32LE" buffer="fast" noAssert="true"                                                                     4.22 %             2.660515e-01
 buffers/buffer-read.js millions=1 type="UInt32LE" buffer="slow" noAssert="false"                                                                   -0.45 %             8.419638e-01
 buffers/buffer-read.js millions=1 type="UInt32LE" buffer="slow" noAssert="true"                                                                     2.65 %             4.064618e-01
 buffers/buffer-read.js millions=1 type="UInt8" buffer="fast" noAssert="false"                                                                      -1.76 %             6.157053e-01
 buffers/buffer-read.js millions=1 type="UInt8" buffer="fast" noAssert="true"                                                                        1.79 %             5.589684e-01
 buffers/buffer-read.js millions=1 type="UInt8" buffer="slow" noAssert="false"                                                                       3.39 %             1.290433e-01
 buffers/buffer-read.js millions=1 type="UInt8" buffer="slow" noAssert="true"                                                                        4.25 %             2.632889e-01
 buffers/buffer-slice.js n=1024 type="fast"                                                                                                          0.12 %             9.465963e-01
 buffers/buffer-slice.js n=1024 type="slow"                                                                                                         -0.17 %             8.758580e-01
 buffers/buffer-swap.js n=50000000 len=1024 method="swap16" aligned="false"                                                                          0.72 %             9.809239e-02
 buffers/buffer-swap.js n=50000000 len=1024 method="swap16" aligned="true"                                                                           0.23 %             2.236034e-01
 buffers/buffer-swap.js n=50000000 len=1024 method="swap32" aligned="false"                                                                          1.83 %           * 1.158038e-02
 buffers/buffer-swap.js n=50000000 len=1024 method="swap32" aligned="true"                                                                           0.60 %             3.452454e-01
 buffers/buffer-swap.js n=50000000 len=1024 method="swap64" aligned="false"                                                                         -0.01 %             9.773489e-01
 buffers/buffer-swap.js n=50000000 len=1024 method="swap64" aligned="true"                                                                           0.17 %             5.253134e-01
 buffers/buffer-swap.js n=50000000 len=128 method="swap16" aligned="false"                                                                           8.36 %         *** 5.748127e-04
 buffers/buffer-swap.js n=50000000 len=128 method="swap16" aligned="true"                                                                           -0.20 %             6.428970e-01
 buffers/buffer-swap.js n=50000000 len=128 method="swap32" aligned="false"                                                                           0.21 %             3.703615e-01
 buffers/buffer-swap.js n=50000000 len=128 method="swap32" aligned="true"                                                                            0.66 %             4.632704e-01
 buffers/buffer-swap.js n=50000000 len=128 method="swap64" aligned="false"                                                                           0.25 %             2.096322e-01
 buffers/buffer-swap.js n=50000000 len=128 method="swap64" aligned="true"                                                                            0.03 %             9.127307e-01
 buffers/buffer-swap.js n=50000000 len=1536 method="swap16" aligned="false"                                                                          0.67 %             5.408411e-02
 buffers/buffer-swap.js n=50000000 len=1536 method="swap16" aligned="true"                                                                           0.14 %             4.457590e-01
 buffers/buffer-swap.js n=50000000 len=1536 method="swap32" aligned="false"                                                                          1.34 %           * 1.728387e-02
 buffers/buffer-swap.js n=50000000 len=1536 method="swap32" aligned="true"                                                                           0.84 %             2.382281e-01
 buffers/buffer-swap.js n=50000000 len=1536 method="swap64" aligned="false"                                                                          0.17 %             4.502700e-01
 buffers/buffer-swap.js n=50000000 len=1536 method="swap64" aligned="true"                                                                           0.30 %             2.428025e-01
 buffers/buffer-swap.js n=50000000 len=2056 method="swap16" aligned="false"                                                                          0.56 %             6.208748e-02
 buffers/buffer-swap.js n=50000000 len=2056 method="swap16" aligned="true"                                                                           0.24 %             1.858673e-01
 buffers/buffer-swap.js n=50000000 len=2056 method="swap32" aligned="false"                                                                          1.21 %          ** 3.388105e-03
 buffers/buffer-swap.js n=50000000 len=2056 method="swap32" aligned="true"                                                                           0.70 %             2.989990e-01
 buffers/buffer-swap.js n=50000000 len=2056 method="swap64" aligned="false"                                                                         -0.16 %             4.430901e-01
 buffers/buffer-swap.js n=50000000 len=2056 method="swap64" aligned="true"                                                                           0.28 %             1.697438e-01
 buffers/buffer-swap.js n=50000000 len=256 method="swap16" aligned="false"                                                                           2.56 %           * 3.002227e-02
 buffers/buffer-swap.js n=50000000 len=256 method="swap16" aligned="true"                                                                            0.43 %           * 2.742431e-02
 buffers/buffer-swap.js n=50000000 len=256 method="swap32" aligned="false"                                                                           3.24 %           * 2.630554e-02
 buffers/buffer-swap.js n=50000000 len=256 method="swap32" aligned="true"                                                                            0.89 %             2.818194e-01
 buffers/buffer-swap.js n=50000000 len=256 method="swap64" aligned="false"                                                                           0.19 %             7.137768e-01
 buffers/buffer-swap.js n=50000000 len=256 method="swap64" aligned="true"                                                                            1.79 %         *** 9.228565e-06
 buffers/buffer-swap.js n=50000000 len=4096 method="swap16" aligned="false"                                                                          0.48 %           * 1.620757e-02
 buffers/buffer-swap.js n=50000000 len=4096 method="swap16" aligned="true"                                                                           0.22 %             2.040544e-01
 buffers/buffer-swap.js n=50000000 len=4096 method="swap32" aligned="false"                                                                          0.26 %             3.093509e-01
 buffers/buffer-swap.js n=50000000 len=4096 method="swap32" aligned="true"                                                                           0.43 %             4.942188e-01
 buffers/buffer-swap.js n=50000000 len=4096 method="swap64" aligned="false"                                                                          0.04 %             8.419400e-01
 buffers/buffer-swap.js n=50000000 len=4096 method="swap64" aligned="true"                                                                           0.07 %             7.158100e-01
 buffers/buffer-swap.js n=50000000 len=512 method="swap16" aligned="false"                                                                           1.48 %             5.285946e-02
 buffers/buffer-swap.js n=50000000 len=512 method="swap16" aligned="true"                                                                            0.02 %             9.091293e-01
 buffers/buffer-swap.js n=50000000 len=512 method="swap32" aligned="false"                                                                           2.25 %           * 2.512926e-02
 buffers/buffer-swap.js n=50000000 len=512 method="swap32" aligned="true"                                                                            0.62 %             2.840412e-01
 buffers/buffer-swap.js n=50000000 len=512 method="swap64" aligned="false"                                                                           0.46 %             8.699367e-02
 buffers/buffer-swap.js n=50000000 len=512 method="swap64" aligned="true"                                                                            1.61 %         *** 1.363688e-06
 buffers/buffer-swap.js n=50000000 len=64 method="swap16" aligned="false"                                                                            0.14 %             5.113253e-01
 buffers/buffer-swap.js n=50000000 len=64 method="swap16" aligned="true"                                                                            -0.01 %             9.608600e-01
 buffers/buffer-swap.js n=50000000 len=64 method="swap32" aligned="false"                                                                            0.08 %             7.459225e-01
 buffers/buffer-swap.js n=50000000 len=64 method="swap32" aligned="true"                                                                             0.35 %             3.739231e-01
 buffers/buffer-swap.js n=50000000 len=64 method="swap64" aligned="false"                                                                            0.17 %             4.150318e-01
 buffers/buffer-swap.js n=50000000 len=64 method="swap64" aligned="true"                                                                             0.17 %             5.602302e-01
 buffers/buffer-swap.js n=50000000 len=768 method="swap16" aligned="false"                                                                           1.23 %           * 1.915928e-02
 buffers/buffer-swap.js n=50000000 len=768 method="swap16" aligned="true"                                                                            0.17 %             3.734867e-01
 buffers/buffer-swap.js n=50000000 len=768 method="swap32" aligned="false"                                                                           2.33 %           * 1.078304e-02
 buffers/buffer-swap.js n=50000000 len=768 method="swap32" aligned="true"                                                                            0.54 %             4.597528e-01
 buffers/buffer-swap.js n=50000000 len=768 method="swap64" aligned="false"                                                                          -0.09 %             8.431402e-01
 buffers/buffer-swap.js n=50000000 len=768 method="swap64" aligned="true"                                                                            0.46 %             7.674447e-02
 buffers/buffer-swap.js n=50000000 len=8192 method="swap16" aligned="false"                                                                          0.23 %             2.495725e-01
 buffers/buffer-swap.js n=50000000 len=8192 method="swap16" aligned="true"                                                                           0.20 %             3.363774e-01
 buffers/buffer-swap.js n=50000000 len=8192 method="swap32" aligned="false"                                                                          0.42 %           * 4.265218e-02
 buffers/buffer-swap.js n=50000000 len=8192 method="swap32" aligned="true"                                                                           0.01 %             9.537111e-01
 buffers/buffer-swap.js n=50000000 len=8192 method="swap64" aligned="false"                                                                          0.08 %             6.843852e-01
 buffers/buffer-swap.js n=50000000 len=8192 method="swap64" aligned="true"                                                                           0.12 %             5.495020e-01
 buffers/buffer-swap.js n=50000000 len=8 method="swap16" aligned="false"                                                                            -0.32 %             2.198962e-01
 buffers/buffer-swap.js n=50000000 len=8 method="swap16" aligned="true"                                                                              1.77 %             9.569371e-02
 buffers/buffer-swap.js n=50000000 len=8 method="swap32" aligned="false"                                                                             0.26 %             3.495595e-01
 buffers/buffer-swap.js n=50000000 len=8 method="swap32" aligned="true"                                                                              0.15 %             6.847003e-01
 buffers/buffer-swap.js n=50000000 len=8 method="swap64" aligned="false"                                                                             0.11 %             6.325445e-01
 buffers/buffer-swap.js n=50000000 len=8 method="swap64" aligned="true"                                                                              0.12 %             7.219655e-01
 buffers/buffer-tostring.js n=10000000 len=0 arg="false"                                                                                             0.25 %             5.598026e-01
 buffers/buffer-tostring.js n=10000000 len=0 arg="true"                                                                                              0.47 %             1.151176e-01
 buffers/buffer-tostring.js n=10000000 len=1024 arg="false"                                                                                         -0.17 %             6.426541e-01
 buffers/buffer-tostring.js n=10000000 len=1024 arg="true"                                                                                           2.44 %          ** 3.853967e-03
 buffers/buffer-tostring.js n=10000000 len=1 arg="false"                                                                                             0.64 %             5.148329e-02
 buffers/buffer-tostring.js n=10000000 len=1 arg="true"                                                                                              0.03 %             9.132085e-01
 buffers/buffer-tostring.js n=10000000 len=64 arg="false"                                                                                            0.47 %             1.392449e-01
 buffers/buffer-tostring.js n=10000000 len=64 arg="true"                                                                                            -0.16 %             6.332427e-01
 buffers/buffer-write.js millions=1 type="DoubleBE" buffer="fast" noAssert="false"                                                                  -0.58 %             3.398289e-01
 buffers/buffer-write.js millions=1 type="DoubleBE" buffer="fast" noAssert="true"                                                                   -0.40 %             4.515062e-01
 buffers/buffer-write.js millions=1 type="DoubleBE" buffer="slow" noAssert="false"                                                                   0.10 %             8.833849e-01
 buffers/buffer-write.js millions=1 type="DoubleBE" buffer="slow" noAssert="true"                                                                   -0.25 %             6.332746e-01
 buffers/buffer-write.js millions=1 type="DoubleLE" buffer="fast" noAssert="false"                                                                  -1.02 %             8.618611e-02
 buffers/buffer-write.js millions=1 type="DoubleLE" buffer="fast" noAssert="true"                                                                    0.06 %             9.531467e-01
 buffers/buffer-write.js millions=1 type="DoubleLE" buffer="slow" noAssert="false"                                                                  -0.04 %             9.413074e-01
 buffers/buffer-write.js millions=1 type="DoubleLE" buffer="slow" noAssert="true"                                                                    0.93 %             1.329555e-01
 buffers/buffer-write.js millions=1 type="FloatBE" buffer="fast" noAssert="false"                                                                    1.54 %           * 1.878570e-02
 buffers/buffer-write.js millions=1 type="FloatBE" buffer="fast" noAssert="true"                                                                     1.31 %             7.052881e-02
 buffers/buffer-write.js millions=1 type="FloatBE" buffer="slow" noAssert="false"                                                                    0.88 %             1.889604e-01
 buffers/buffer-write.js millions=1 type="FloatBE" buffer="slow" noAssert="true"                                                                     2.88 %           * 2.500116e-02
 buffers/buffer-write.js millions=1 type="FloatLE" buffer="fast" noAssert="false"                                                                    2.82 %         *** 9.326764e-06
 buffers/buffer-write.js millions=1 type="FloatLE" buffer="fast" noAssert="true"                                                                     3.44 %         *** 1.127102e-06
 buffers/buffer-write.js millions=1 type="FloatLE" buffer="slow" noAssert="false"                                                                    2.29 %         *** 2.142062e-04
 buffers/buffer-write.js millions=1 type="FloatLE" buffer="slow" noAssert="true"                                                                     3.47 %         *** 1.540476e-07
 buffers/buffer-write.js millions=1 type="Int16BE" buffer="fast" noAssert="false"                                                                  373.39 %         *** 5.758374e-45
 buffers/buffer-write.js millions=1 type="Int16BE" buffer="fast" noAssert="true"                                                                     1.08 %             7.279496e-01
 buffers/buffer-write.js millions=1 type="Int16BE" buffer="slow" noAssert="false"                                                                  374.95 %         *** 2.886506e-38
 buffers/buffer-write.js millions=1 type="Int16BE" buffer="slow" noAssert="true"                                                                    -1.31 %             6.932251e-01
 buffers/buffer-write.js millions=1 type="Int16LE" buffer="fast" noAssert="false"                                                                  373.82 %         *** 1.179914e-45
 buffers/buffer-write.js millions=1 type="Int16LE" buffer="fast" noAssert="true"                                                                    -3.79 %             1.997305e-01
 buffers/buffer-write.js millions=1 type="Int16LE" buffer="slow" noAssert="false"                                                                  378.53 %         *** 6.633421e-47
 buffers/buffer-write.js millions=1 type="Int16LE" buffer="slow" noAssert="true"                                                                     1.63 %             6.271788e-01
 buffers/buffer-write.js millions=1 type="Int32BE" buffer="fast" noAssert="false"                                                                  359.81 %         *** 4.468876e-36
 buffers/buffer-write.js millions=1 type="Int32BE" buffer="fast" noAssert="true"                                                                     0.28 %             9.300014e-01
 buffers/buffer-write.js millions=1 type="Int32BE" buffer="slow" noAssert="false"                                                                  365.23 %         *** 3.667399e-46
 buffers/buffer-write.js millions=1 type="Int32BE" buffer="slow" noAssert="true"                                                                    -1.13 %             7.262130e-01
 buffers/buffer-write.js millions=1 type="Int32LE" buffer="fast" noAssert="false"                                                                  363.26 %         *** 3.212750e-40
 buffers/buffer-write.js millions=1 type="Int32LE" buffer="fast" noAssert="true"                                                                     3.54 %             2.226230e-01
 buffers/buffer-write.js millions=1 type="Int32LE" buffer="slow" noAssert="false"                                                                  362.38 %         *** 2.621477e-41
 buffers/buffer-write.js millions=1 type="Int32LE" buffer="slow" noAssert="true"                                                                     0.87 %             7.827498e-01
 buffers/buffer-write.js millions=1 type="Int8" buffer="fast" noAssert="false"                                                                     379.73 %         *** 2.298813e-44
 buffers/buffer-write.js millions=1 type="Int8" buffer="fast" noAssert="true"                                                                       -4.20 %             2.479855e-01
 buffers/buffer-write.js millions=1 type="Int8" buffer="slow" noAssert="false"                                                                     387.10 %         *** 2.288842e-49
 buffers/buffer-write.js millions=1 type="Int8" buffer="slow" noAssert="true"                                                                        0.10 %             9.730214e-01
 buffers/buffer-write.js millions=1 type="UInt16BE" buffer="fast" noAssert="false"                                                                 368.54 %         *** 4.019250e-37
 buffers/buffer-write.js millions=1 type="UInt16BE" buffer="fast" noAssert="true"                                                                    2.32 %             4.378903e-01
 buffers/buffer-write.js millions=1 type="UInt16BE" buffer="slow" noAssert="false"                                                                 375.49 %         *** 6.909551e-47
 buffers/buffer-write.js millions=1 type="UInt16BE" buffer="slow" noAssert="true"                                                                    3.22 %             3.136021e-01
 buffers/buffer-write.js millions=1 type="UInt16LE" buffer="fast" noAssert="false"                                                                 370.98 %         *** 2.698867e-39
 buffers/buffer-write.js millions=1 type="UInt16LE" buffer="fast" noAssert="true"                                                                    0.19 %             9.515645e-01
 buffers/buffer-write.js millions=1 type="UInt16LE" buffer="slow" noAssert="false"                                                                 374.03 %         *** 1.939317e-43
 buffers/buffer-write.js millions=1 type="UInt16LE" buffer="slow" noAssert="true"                                                                    3.73 %             2.493963e-01
 buffers/buffer-write.js millions=1 type="UInt32BE" buffer="fast" noAssert="false"                                                                 348.91 %         *** 1.049299e-44
 buffers/buffer-write.js millions=1 type="UInt32BE" buffer="fast" noAssert="true"                                                                    0.41 %             9.013436e-01
 buffers/buffer-write.js millions=1 type="UInt32BE" buffer="slow" noAssert="false"                                                                 351.56 %         *** 9.156560e-49
 buffers/buffer-write.js millions=1 type="UInt32BE" buffer="slow" noAssert="true"                                                                   -3.30 %             2.827632e-01
 buffers/buffer-write.js millions=1 type="UInt32LE" buffer="fast" noAssert="false"                                                                 344.12 %         *** 1.214096e-31
 buffers/buffer-write.js millions=1 type="UInt32LE" buffer="fast" noAssert="true"                                                                    1.51 %             5.666565e-01
 buffers/buffer-write.js millions=1 type="UInt32LE" buffer="slow" noAssert="false"                                                                 352.90 %         *** 3.244350e-44
 buffers/buffer-write.js millions=1 type="UInt32LE" buffer="slow" noAssert="true"                                                                   -1.84 %             5.294890e-01
 buffers/buffer-write.js millions=1 type="UInt8" buffer="fast" noAssert="false"                                                                    376.14 %         *** 3.505424e-47
 buffers/buffer-write.js millions=1 type="UInt8" buffer="fast" noAssert="true"                                                                       4.61 %             9.893927e-02
 buffers/buffer-write.js millions=1 type="UInt8" buffer="slow" noAssert="false"                                                                    376.86 %         *** 1.417748e-47
 buffers/buffer-write.js millions=1 type="UInt8" buffer="slow" noAssert="true"                                                                      -2.70 %             4.419909e-01
 buffers/buffer_zero.js type="buffer" n=1024                                                                                                        89.70 %         *** 4.644630e-87
 buffers/buffer_zero.js type="string" n=1024                                                                                                        -5.85 %         *** 5.429638e-07
 buffers/dataview-set.js millions=1 type="Float32BE"                                                                                                 0.13 %             7.709391e-01
 buffers/dataview-set.js millions=1 type="Float32LE"                                                                                                -0.01 %             9.800722e-01
 buffers/dataview-set.js millions=1 type="Float64BE"                                                                                                -0.26 %             5.614375e-01
 buffers/dataview-set.js millions=1 type="Float64LE"                                                                                                 0.48 %             3.894129e-01
 buffers/dataview-set.js millions=1 type="Int16BE"                                                                                                   0.09 %             8.604741e-01
 buffers/dataview-set.js millions=1 type="Int16LE"                                                                                                  -0.02 %             9.588750e-01
 buffers/dataview-set.js millions=1 type="Int32BE"                                                                                                   0.27 %             6.324183e-01
 buffers/dataview-set.js millions=1 type="Int32LE"                                                                                                  -0.52 %             4.388504e-01
 buffers/dataview-set.js millions=1 type="Int8"                                                                                                      2.44 %         *** 4.957827e-05
 buffers/dataview-set.js millions=1 type="Uint16BE"                                                                                                  0.59 %             4.320600e-01
 buffers/dataview-set.js millions=1 type="Uint16LE"                                                                                                 -0.98 %             1.570108e-01
 buffers/dataview-set.js millions=1 type="Uint32BE"                                                                                                 -0.16 %             7.642430e-01
 buffers/dataview-set.js millions=1 type="Uint32LE"                                                                                                 -0.66 %             1.920751e-01
 buffers/dataview-set.js millions=1 type="Uint8"                                                                                                     1.46 %             3.819803e-01

/cc @nodejs/buffer

CI: https://ci.nodejs.org/job/node-test-commit/6602/

Allow all methods on `buffer` and `Buffer` to take `Uint8Array`
arguments where it makes sense. On the native side, there is
effectively no difference, and as a bonus the `isUint8Array`
check is faster than `instanceof Buffer`.
@addaleax addaleax added buffer Issues and PRs related to the buffer subsystem. semver-minor PRs that contain new features and should be released in the next minor version. labels Dec 12, 2016
@mscdex
Copy link
Contributor

mscdex commented Dec 12, 2016

Make sure to run benchmarks before backporting, because I'm quite surprised that replacing obj.copy() with Buffer.prototype.copy.call(obj, ...) does not make things slower... Did you try benchmarking a conditional instead of always using .call()?

Copy link
Contributor

@trevnorris trevnorris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Just one minor change.

const b = allocate(obj.length);

if (b.length === 0)
return b;

obj.copy(b, 0, 0, obj.length);
Buffer.prototype.copy.call(obj, b, 0, 0, obj.length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't need to reference it this way. copy() is native method. Can simply call binding.copy(...).

throw new TypeError('"list" argument must be an Array of Buffers');
buf.copy(buffer, pos);
Buffer.prototype.copy.call(buf, buffer, pos);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto on using binding.copy().

@addaleax
Copy link
Member Author

@trevnorris I’ve updated this and moved .copy from the prototype to the binding object… please take a look and tell me if that’s what you had in mind, I’m not a hundred percent sure

@trevnorris
Copy link
Contributor

Changes look great. Thanks.

@@ -283,8 +284,7 @@ Buffer.isBuffer = function isBuffer(b) {


Buffer.compare = function compare(a, b) {
if (!(a instanceof Buffer) ||
!(b instanceof Buffer)) {
if (!isUint8Array(a) || !isUint8Array(b)) {
throw new TypeError('Arguments must be Buffers');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this error message will need to be changed

@@ -322,9 +322,9 @@ Buffer.concat = function(list, length) {
var pos = 0;
for (i = 0; i < list.length; i++) {
var buf = list[i];
if (!Buffer.isBuffer(buf))
if (!isUint8Array(buf))
throw new TypeError('"list" argument must be an Array of Buffers');
Copy link
Contributor

@mscdex mscdex Dec 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here and elsewhere about error messages

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but echoing @mscdex, some error messages need updating.

@mscdex mscdex added semver-major PRs that contain breaking changes and should be released in the next major version. and removed semver-minor PRs that contain new features and should be released in the next minor version. labels Dec 13, 2016
@mscdex
Copy link
Contributor

mscdex commented Dec 13, 2016

Marking this as semver-major because of the change in error messages...

@addaleax
Copy link
Member Author

@mscdex @bnoordhuis Would you be okay with me updating the error messages in a follow-up PR? I know they need to be changed and I know that that’s semver-major, it just feels a bit silly to hold up the rest of the PR on that

@mscdex
Copy link
Contributor

mscdex commented Dec 13, 2016

I don't think intentionally leaving incorrect error messages is a good idea.

@addaleax
Copy link
Member Author

Alright, updated with error messages changed.

CI: https://ci.nodejs.org/job/node-test-commit/6621/
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/478/

Copy link
Member

@ChALkeR ChALkeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this would also allow to slightly reduce the forced usage of Buffer() objects where an Uint8Array constructor is actually sufficient. 👍

@addaleax
Copy link
Member Author

Landed in beca324, thanks for the reviews!

@addaleax addaleax closed this Dec 21, 2016
@addaleax addaleax deleted the generic-buffers branch December 21, 2016 06:49
addaleax added a commit that referenced this pull request Dec 21, 2016
Allow all methods on `buffer` and `Buffer` to take `Uint8Array`
arguments where it makes sense. On the native side, there is
effectively no difference, and as a bonus the `isUint8Array`
check is faster than `instanceof Buffer`.

PR-URL: #10236
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 18, 2017
Allow all methods on `buffer` and `Buffer` to take `Uint8Array`
arguments where it makes sense. On the native side, there is
effectively no difference, and as a bonus the `isUint8Array`
check is faster than `instanceof Buffer`.

PR-URL: nodejs#10236
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
addaleax added a commit to addaleax/node that referenced this pull request Feb 22, 2017
This was semi-overlooked in nodejs#10236
because it always worked and didn’t need additional changes.

Ref: nodejs#10236
addaleax added a commit that referenced this pull request Feb 24, 2017
This was semi-overlooked in #10236
because it always worked and didn’t need additional changes.

Ref: #10236
PR-URL: #11486
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
addaleax added a commit that referenced this pull request Feb 24, 2017
This was semi-overlooked in #10236
because it always worked and didn’t need additional changes.

Ref: #10236
PR-URL: #11486
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
jasnell pushed a commit that referenced this pull request Mar 7, 2017
This was semi-overlooked in #10236
because it always worked and didn’t need additional changes.

Ref: #10236
PR-URL: #11486
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
This was semi-overlooked in #10236
because it always worked and didn’t need additional changes.

Ref: #10236
PR-URL: #11486
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@jasnell jasnell mentioned this pull request Apr 4, 2017
jasnell added a commit to jasnell/node that referenced this pull request May 29, 2017
* **Async Hooks**
  * The `async_hooks` module has landed in core
    [[`4a7233c178`](nodejs@4a7233c178)]
    [nodejs#12892](nodejs#12892).

* **Buffer**
  * Using the `--pending-deprecation` flag will cause Node.js to emit a
    deprecation warning when using `new Buffer(num)` or `Buffer(num)`.
    [[`d2d32ea5a2`](nodejs@d2d32ea5a2)]
    [nodejs#11968](nodejs#11968).
  * `new Buffer(num)` and `Buffer(num)` will zero-fill new `Buffer` instances
    [[`7eb1b4658e`](nodejs@7eb1b4658e)]
    [nodejs#12141](nodejs#12141).
  * Many `Buffer` methods now accept `Uint8Array` as input
    [[`beca3244e2`](nodejs@beca3244e2)]
    [nodejs#10236](nodejs#10236).

* **Child Process**
  * Argument and kill signal validations have been improved
    [[`97a77288ce`](nodejs@97a77288ce)]
    [nodejs#12348](nodejs#12348),
    [[`d75fdd96aa`](nodejs@d75fdd96aa)]
    [nodejs#10423](nodejs#10423).
  * Child Process methods accept `Uint8Array` as input
    [[`627ecee9ed`](nodejs@627ecee9ed)]
    [nodejs#10653](nodejs#10653).

* **Console**
  * Error events emitted when using `console` methods are now supressed.
    [[`f18e08d820`](nodejs@f18e08d820)]
    [nodejs#9744](nodejs#9744).

* **Dependencies**
  * The npm client has been updated to 5.0.0
    [[`3c3b36af0f`](nodejs@3c3b36af0f)]
    [nodejs#12936](nodejs#12936).
  * V8 has been updated to 5.8 with forward ABI stability to 6.0
    [[`60d1aac8d2`](nodejs@60d1aac8d2)]
    [nodejs#12784](nodejs#12784).

* **Domains**
  * Native `Promise` instances are now `Domain` aware
    [[`84dabe8373`](nodejs@84dabe8373)]
    [nodejs#12489](nodejs#12489).

* **Errors**
  * We have started assigning static error codes to errors generated by Node.js.
    This has been done through multiple commits and is still a work in
    progress.

* **File System**
  * The utility class `fs.SyncWriteStream` has been deprecated
    [[`7a55e34ef4`](nodejs@7a55e34ef4)]
    [nodejs#10467](nodejs#10467).
  * The deprecated `fs.read()` string interface has been removed
    [[`3c2a9361ff`](nodejs@3c2a9361ff)]
    [nodejs#9683](nodejs#9683).

* **HTTP**
  * Improved support for userland implemented Agents
    [[`90403dd1d0`](nodejs@90403dd1d0)]
    [nodejs#11567](nodejs#11567).
  * Outgoing Cookie headers are concatenated into a single string
    [[`d3480776c7`](nodejs@d3480776c7)]
    [nodejs#11259](nodejs#11259).
  * The `httpResponse.writeHeader()` method has been deprecated
    [[`fb71ba4921`](nodejs@fb71ba4921)]
    [nodejs#11355](nodejs#11355).
  * New methods for accessing HTTP headers have been added to `OutgoingMessage`
    [[`3e6f1032a4`](nodejs@3e6f1032a4)]
    [nodejs#10805](nodejs#10805).

* **Lib**
  * All deprecation messages have been assigned static identifiers
    [[`5de3cf099c`](nodejs@5de3cf099c)]
    [nodejs#10116](nodejs#10116).
  * The legacy `linkedlist` module has been removed
    [[`84a23391f6`](nodejs@84a23391f6)]
    [nodejs#12113](nodejs#12113).

* **N-API**
  * Experimental support for the new N-API API has been added
    [[`56e881d0b0`](nodejs@56e881d0b0)]
    [nodejs#11975](nodejs#11975).

* **Process**
  * Process warning output can be redirected to a file using the
    `--redirect-warnings` command-line argument
    [[`03e89b3ff2`](nodejs@03e89b3ff2)]
    [nodejs#10116](nodejs#10116).
  * Process warnings may now include additional detail
    [[`dd20e68b0f`](nodejs@dd20e68b0f)]
    [nodejs#12725](nodejs#12725).

* **REPL**
  * REPL magic mode has been deprecated
    [[`3f27f02da0`](nodejs@3f27f02da0)]
    [nodejs#11599](nodejs#11599).

* **Src**
  * `NODE_MODULE_VERSION` has been updated to 57
    (nodejs@ec7cbaf266)]
    [nodejs#12995](nodejs#12995).
  * Add `--pending-deprecation` command-line argument and
    `NODE_PENDING_DEPRECATION` environment variable
    [[`a16b570f8c`](nodejs@a16b570f8c)]
    [nodejs#11968](nodejs#11968).
  * The `--debug` command-line argument has been deprecated. Note that
    using `--debug` will enable the *new* Inspector-based debug protocol
    as the legacy Debugger protocol previously used by Node.js has been
    removed. [[`010f864426`](nodejs@010f864426)]
    [nodejs#12949](nodejs#12949).
  * Throw when the `-c` and `-e` command-line arguments are used at the same
    time [[`a5f91ab230`](nodejs@a5f91ab230)]
    [nodejs#11689](nodejs#11689).
  * Throw when the `--use-bundled-ca` and `--use-openssl-ca` command-line
    arguments are used at the same time.
    [[`8a7db9d4b5`](nodejs@8a7db9d4b5)]
    [nodejs#12087](nodejs#12087).

* **Stream**
  * `Stream` now supports `destroy()` and `_destroy()` APIs
    [[`b6e1d22fa6`](nodejs@b6e1d22fa6)]
    [nodejs#12925](nodejs#12925).
  * `Stream` now supports the `_final()` API
    [[`07c7f198db`](nodejs@07c7f198db)]
    [nodejs#12828](nodejs#12828).

* **TLS**
  * The `rejectUnauthorized` option now defaults to `true`
    [[`348cc80a3c`](nodejs@348cc80a3c)]
    [nodejs#5923](nodejs#5923).
  * The `tls.createSecurePair()` API now emits a runtime deprecation
    [[`a2ae08999b`](nodejs@a2ae08999b)]
    [nodejs#11349](nodejs#11349).
  * A runtime deprecation will now be emitted when `dhparam` is less than
    2048 bits [[`d523eb9c40`](nodejs@d523eb9c40)]
    [nodejs#11447](nodejs#11447).

* **URL**
  * The WHATWG URL implementation is now a fully-supported Node.js API
    [[`d080ead0f9`](nodejs@d080ead0f9)]
    [nodejs#12710](nodejs#12710).

* **Util**
  * `Symbol` keys are now displayed by default when using `util.inspect()`
    [[`5bfd13b81e`](nodejs@5bfd13b81e)]
    [nodejs#9726](nodejs#9726).
  * `toJSON` errors will be thrown when formatting `%j`
    [[`455e6f1dd8`](nodejs@455e6f1dd8)]
    [nodejs#11708](nodejs#11708).
  * Convert `inspect.styles` and `inspect.colors` to prototype-less objects
    [[`aab0d202f8`](nodejs@aab0d202f8)]
    [nodejs#11624](nodejs#11624).
  * The new `util.promisify()` API has been added
    [[`99da8e8e02`](nodejs@99da8e8e02)]
    [nodejs#12442](nodejs#12442).

* **Zlib**
  * Support `Uint8Array` in Zlib convenience methods
    [[`91383e47fd`](nodejs@91383e47fd)]
    [nodejs#12001](nodejs#12001).
  * Zlib errors now use `RangeError` and `TypeError` consistently
    [[`b514bd231e`](nodejs@b514bd231e)]
    [nodejs#11391](nodejs#11391).
jasnell added a commit that referenced this pull request May 30, 2017
* **Async Hooks**
  * The `async_hooks` module has landed in core
    [[`4a7233c178`](4a7233c178)]
    [#12892](#12892).

* **Buffer**
  * Using the `--pending-deprecation` flag will cause Node.js to emit a
    deprecation warning when using `new Buffer(num)` or `Buffer(num)`.
    [[`d2d32ea5a2`](d2d32ea5a2)]
    [#11968](#11968).
  * `new Buffer(num)` and `Buffer(num)` will zero-fill new `Buffer` instances
    [[`7eb1b4658e`](7eb1b4658e)]
    [#12141](#12141).
  * Many `Buffer` methods now accept `Uint8Array` as input
    [[`beca3244e2`](beca3244e2)]
    [#10236](#10236).

* **Child Process**
  * Argument and kill signal validations have been improved
    [[`97a77288ce`](97a77288ce)]
    [#12348](#12348),
    [[`d75fdd96aa`](d75fdd96aa)]
    [#10423](#10423).
  * Child Process methods accept `Uint8Array` as input
    [[`627ecee9ed`](627ecee9ed)]
    [#10653](#10653).

* **Console**
  * Error events emitted when using `console` methods are now supressed.
    [[`f18e08d820`](f18e08d820)]
    [#9744](#9744).

* **Dependencies**
  * The npm client has been updated to 5.0.0
    [[`3c3b36af0f`](3c3b36af0f)]
    [#12936](#12936).
  * V8 has been updated to 5.8 with forward ABI stability to 6.0
    [[`60d1aac8d2`](60d1aac8d2)]
    [#12784](#12784).

* **Domains**
  * Native `Promise` instances are now `Domain` aware
    [[`84dabe8373`](84dabe8373)]
    [#12489](#12489).

* **Errors**
  * We have started assigning static error codes to errors generated by Node.js.
    This has been done through multiple commits and is still a work in
    progress.

* **File System**
  * The utility class `fs.SyncWriteStream` has been deprecated
    [[`7a55e34ef4`](7a55e34ef4)]
    [#10467](#10467).
  * The deprecated `fs.read()` string interface has been removed
    [[`3c2a9361ff`](3c2a9361ff)]
    [#9683](#9683).

* **HTTP**
  * Improved support for userland implemented Agents
    [[`90403dd1d0`](90403dd1d0)]
    [#11567](#11567).
  * Outgoing Cookie headers are concatenated into a single string
    [[`d3480776c7`](d3480776c7)]
    [#11259](#11259).
  * The `httpResponse.writeHeader()` method has been deprecated
    [[`fb71ba4921`](fb71ba4921)]
    [#11355](#11355).
  * New methods for accessing HTTP headers have been added to `OutgoingMessage`
    [[`3e6f1032a4`](3e6f1032a4)]
    [#10805](#10805).

* **Lib**
  * All deprecation messages have been assigned static identifiers
    [[`5de3cf099c`](5de3cf099c)]
    [#10116](#10116).
  * The legacy `linkedlist` module has been removed
    [[`84a23391f6`](84a23391f6)]
    [#12113](#12113).

* **N-API**
  * Experimental support for the new N-API API has been added
    [[`56e881d0b0`](56e881d0b0)]
    [#11975](#11975).

* **Process**
  * Process warning output can be redirected to a file using the
    `--redirect-warnings` command-line argument
    [[`03e89b3ff2`](03e89b3ff2)]
    [#10116](#10116).
  * Process warnings may now include additional detail
    [[`dd20e68b0f`](dd20e68b0f)]
    [#12725](#12725).

* **REPL**
  * REPL magic mode has been deprecated
    [[`3f27f02da0`](3f27f02da0)]
    [#11599](#11599).

* **Src**
  * `NODE_MODULE_VERSION` has been updated to 57
    (ec7cbaf266)]
    [#12995](#12995).
  * Add `--pending-deprecation` command-line argument and
    `NODE_PENDING_DEPRECATION` environment variable
    [[`a16b570f8c`](a16b570f8c)]
    [#11968](#11968).
  * The `--debug` command-line argument has been deprecated. Note that
    using `--debug` will enable the *new* Inspector-based debug protocol
    as the legacy Debugger protocol previously used by Node.js has been
    removed. [[`010f864426`](010f864426)]
    [#12949](#12949).
  * Throw when the `-c` and `-e` command-line arguments are used at the same
    time [[`a5f91ab230`](a5f91ab230)]
    [#11689](#11689).
  * Throw when the `--use-bundled-ca` and `--use-openssl-ca` command-line
    arguments are used at the same time.
    [[`8a7db9d4b5`](8a7db9d4b5)]
    [#12087](#12087).

* **Stream**
  * `Stream` now supports `destroy()` and `_destroy()` APIs
    [[`b6e1d22fa6`](b6e1d22fa6)]
    [#12925](#12925).
  * `Stream` now supports the `_final()` API
    [[`07c7f198db`](07c7f198db)]
    [#12828](#12828).

* **TLS**
  * The `rejectUnauthorized` option now defaults to `true`
    [[`348cc80a3c`](348cc80a3c)]
    [#5923](#5923).
  * The `tls.createSecurePair()` API now emits a runtime deprecation
    [[`a2ae08999b`](a2ae08999b)]
    [#11349](#11349).
  * A runtime deprecation will now be emitted when `dhparam` is less than
    2048 bits [[`d523eb9c40`](d523eb9c40)]
    [#11447](#11447).

* **URL**
  * The WHATWG URL implementation is now a fully-supported Node.js API
    [[`d080ead0f9`](d080ead0f9)]
    [#12710](#12710).

* **Util**
  * `Symbol` keys are now displayed by default when using `util.inspect()`
    [[`5bfd13b81e`](5bfd13b81e)]
    [#9726](#9726).
  * `toJSON` errors will be thrown when formatting `%j`
    [[`455e6f1dd8`](455e6f1dd8)]
    [#11708](#11708).
  * Convert `inspect.styles` and `inspect.colors` to prototype-less objects
    [[`aab0d202f8`](aab0d202f8)]
    [#11624](#11624).
  * The new `util.promisify()` API has been added
    [[`99da8e8e02`](99da8e8e02)]
    [#12442](#12442).

* **Zlib**
  * Support `Uint8Array` in Zlib convenience methods
    [[`91383e47fd`](91383e47fd)]
    [#12001](#12001).
  * Zlib errors now use `RangeError` and `TypeError` consistently
    [[`b514bd231e`](b514bd231e)]
    [#11391](#11391).
jasnell added a commit that referenced this pull request May 30, 2017
* **Async Hooks**
  * The `async_hooks` module has landed in core
    [[`4a7233c178`](4a7233c178)]
    [#12892](#12892).

* **Buffer**
  * Using the `--pending-deprecation` flag will cause Node.js to emit a
    deprecation warning when using `new Buffer(num)` or `Buffer(num)`.
    [[`d2d32ea5a2`](d2d32ea5a2)]
    [#11968](#11968).
  * `new Buffer(num)` and `Buffer(num)` will zero-fill new `Buffer` instances
    [[`7eb1b4658e`](7eb1b4658e)]
    [#12141](#12141).
  * Many `Buffer` methods now accept `Uint8Array` as input
    [[`beca3244e2`](beca3244e2)]
    [#10236](#10236).

* **Child Process**
  * Argument and kill signal validations have been improved
    [[`97a77288ce`](97a77288ce)]
    [#12348](#12348),
    [[`d75fdd96aa`](d75fdd96aa)]
    [#10423](#10423).
  * Child Process methods accept `Uint8Array` as input
    [[`627ecee9ed`](627ecee9ed)]
    [#10653](#10653).

* **Console**
  * Error events emitted when using `console` methods are now supressed.
    [[`f18e08d820`](f18e08d820)]
    [#9744](#9744).

* **Dependencies**
  * The npm client has been updated to 5.0.0
    [[`3c3b36af0f`](3c3b36af0f)]
    [#12936](#12936).
  * V8 has been updated to 5.8 with forward ABI stability to 6.0
    [[`60d1aac8d2`](60d1aac8d2)]
    [#12784](#12784).

* **Domains**
  * Native `Promise` instances are now `Domain` aware
    [[`84dabe8373`](84dabe8373)]
    [#12489](#12489).

* **Errors**
  * We have started assigning static error codes to errors generated by Node.js.
    This has been done through multiple commits and is still a work in
    progress.

* **File System**
  * The utility class `fs.SyncWriteStream` has been deprecated
    [[`7a55e34ef4`](7a55e34ef4)]
    [#10467](#10467).
  * The deprecated `fs.read()` string interface has been removed
    [[`3c2a9361ff`](3c2a9361ff)]
    [#9683](#9683).

* **HTTP**
  * Improved support for userland implemented Agents
    [[`90403dd1d0`](90403dd1d0)]
    [#11567](#11567).
  * Outgoing Cookie headers are concatenated into a single string
    [[`d3480776c7`](d3480776c7)]
    [#11259](#11259).
  * The `httpResponse.writeHeader()` method has been deprecated
    [[`fb71ba4921`](fb71ba4921)]
    [#11355](#11355).
  * New methods for accessing HTTP headers have been added to `OutgoingMessage`
    [[`3e6f1032a4`](3e6f1032a4)]
    [#10805](#10805).

* **Lib**
  * All deprecation messages have been assigned static identifiers
    [[`5de3cf099c`](5de3cf099c)]
    [#10116](#10116).
  * The legacy `linkedlist` module has been removed
    [[`84a23391f6`](84a23391f6)]
    [#12113](#12113).

* **N-API**
  * Experimental support for the new N-API API has been added
    [[`56e881d0b0`](56e881d0b0)]
    [#11975](#11975).

* **Process**
  * Process warning output can be redirected to a file using the
    `--redirect-warnings` command-line argument
    [[`03e89b3ff2`](03e89b3ff2)]
    [#10116](#10116).
  * Process warnings may now include additional detail
    [[`dd20e68b0f`](dd20e68b0f)]
    [#12725](#12725).

* **REPL**
  * REPL magic mode has been deprecated
    [[`3f27f02da0`](3f27f02da0)]
    [#11599](#11599).

* **Src**
  * `NODE_MODULE_VERSION` has been updated to 57
    (ec7cbaf266)]
    [#12995](#12995).
  * Add `--pending-deprecation` command-line argument and
    `NODE_PENDING_DEPRECATION` environment variable
    [[`a16b570f8c`](a16b570f8c)]
    [#11968](#11968).
  * The `--debug` command-line argument has been deprecated. Note that
    using `--debug` will enable the *new* Inspector-based debug protocol
    as the legacy Debugger protocol previously used by Node.js has been
    removed. [[`010f864426`](010f864426)]
    [#12949](#12949).
  * Throw when the `-c` and `-e` command-line arguments are used at the same
    time [[`a5f91ab230`](a5f91ab230)]
    [#11689](#11689).
  * Throw when the `--use-bundled-ca` and `--use-openssl-ca` command-line
    arguments are used at the same time.
    [[`8a7db9d4b5`](8a7db9d4b5)]
    [#12087](#12087).

* **Stream**
  * `Stream` now supports `destroy()` and `_destroy()` APIs
    [[`b6e1d22fa6`](b6e1d22fa6)]
    [#12925](#12925).
  * `Stream` now supports the `_final()` API
    [[`07c7f198db`](07c7f198db)]
    [#12828](#12828).

* **TLS**
  * The `rejectUnauthorized` option now defaults to `true`
    [[`348cc80a3c`](348cc80a3c)]
    [#5923](#5923).
  * The `tls.createSecurePair()` API now emits a runtime deprecation
    [[`a2ae08999b`](a2ae08999b)]
    [#11349](#11349).
  * A runtime deprecation will now be emitted when `dhparam` is less than
    2048 bits [[`d523eb9c40`](d523eb9c40)]
    [#11447](#11447).

* **URL**
  * The WHATWG URL implementation is now a fully-supported Node.js API
    [[`d080ead0f9`](d080ead0f9)]
    [#12710](#12710).

* **Util**
  * `Symbol` keys are now displayed by default when using `util.inspect()`
    [[`5bfd13b81e`](5bfd13b81e)]
    [#9726](#9726).
  * `toJSON` errors will be thrown when formatting `%j`
    [[`455e6f1dd8`](455e6f1dd8)]
    [#11708](#11708).
  * Convert `inspect.styles` and `inspect.colors` to prototype-less objects
    [[`aab0d202f8`](aab0d202f8)]
    [#11624](#11624).
  * The new `util.promisify()` API has been added
    [[`99da8e8e02`](99da8e8e02)]
    [#12442](#12442).

* **Zlib**
  * Support `Uint8Array` in Zlib convenience methods
    [[`91383e47fd`](91383e47fd)]
    [#12001](#12001).
  * Zlib errors now use `RangeError` and `TypeError` consistently
    [[`b514bd231e`](b514bd231e)]
    [#11391](#11391).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants