1
0
mirror of https://github.com/golang/go synced 2024-11-08 02:06:15 -07:00
go/src/internal
Agniva De Sarker 4a7cd9d9df internal/bytealg: simplify memchr for wasm
Get rid of an extra register R5 which just recalculated the value of R4.
Reuse R4 instead.

We also remove the casting of c to an unsigned char because the initial
load of R0 is done with I32Load8U anyways.

Also indent the code to make it more readable.

name                           old time/op  new time/op  delta
IndexRune                       597ns ± 3%   580ns ± 3%  -2.93%  (p=0.002 n=10+10)
IndexRuneLongString             634ns ± 4%   654ns ± 3%  +3.07%  (p=0.004 n=10+10)
IndexRuneFastPath              57.6ns ± 3%  56.9ns ± 4%    ~     (p=0.210 n=10+10)
Index                           104ns ± 3%   104ns ± 4%    ~     (p=0.639 n=10+10)
LastIndex                      87.1ns ± 5%  85.7ns ± 3%    ~     (p=0.171 n=10+10)
IndexByte                      34.4ns ± 4%  32.9ns ± 5%  -4.28%  (p=0.002 n=10+10)
IndexHard1                     21.6ms ± 1%  21.8ms ± 3%    ~     (p=0.460 n=8+10)
IndexHard2                     21.6ms ± 2%  21.9ms ± 5%    ~     (p=0.133 n=9+10)
IndexHard3                     21.8ms ± 3%  21.7ms ± 1%    ~     (p=0.579 n=10+10)
IndexHard4                     21.6ms ± 1%  21.9ms ± 4%    ~     (p=0.360 n=8+10)
LastIndexHard1                 25.1ms ± 2%  25.4ms ± 5%    ~     (p=0.853 n=10+10)
LastIndexHard2                 25.3ms ± 6%  25.2ms ± 5%    ~     (p=0.796 n=10+10)
LastIndexHard3                 25.3ms ± 4%  25.2ms ± 3%    ~     (p=0.739 n=10+10)
IndexTorture                    130µs ± 3%   133µs ± 5%    ~     (p=0.218 n=10+10)
IndexAnyASCII/1:1              98.4ns ± 5%  96.6ns ± 5%    ~     (p=0.054 n=10+10)
IndexAnyASCII/1:2               109ns ± 4%   110ns ± 3%    ~     (p=0.232 n=10+10)
IndexAnyASCII/1:4               135ns ± 4%   134ns ± 3%    ~     (p=0.671 n=10+10)
IndexAnyASCII/1:8               184ns ± 4%   184ns ± 3%    ~     (p=0.749 n=10+10)
IndexAnyASCII/1:16              289ns ± 3%   281ns ± 3%  -2.73%  (p=0.001 n=9+10)
IndexAnyASCII/16:1              322ns ± 3%   307ns ± 3%  -4.71%  (p=0.000 n=10+10)
IndexAnyASCII/16:2              329ns ± 3%   320ns ± 3%  -2.89%  (p=0.008 n=10+10)
IndexAnyASCII/16:4              353ns ± 3%   339ns ± 3%  -3.91%  (p=0.001 n=10+10)
IndexAnyASCII/16:8              390ns ± 3%   374ns ± 3%  -4.06%  (p=0.000 n=10+10)
IndexAnyASCII/16:16             471ns ± 4%   452ns ± 2%  -4.22%  (p=0.000 n=10+10)
IndexAnyASCII/256:1            2.94µs ± 4%  2.91µs ± 2%    ~     (p=0.424 n=10+10)
IndexAnyASCII/256:2            2.92µs ± 3%  2.90µs ± 2%    ~     (p=0.388 n=9+10)
IndexAnyASCII/256:4            2.93µs ± 1%  2.90µs ± 1%  -0.98%  (p=0.036 n=8+9)
IndexAnyASCII/256:8            3.03µs ± 5%  2.97µs ± 3%    ~     (p=0.085 n=10+10)
IndexAnyASCII/256:16           3.07µs ± 4%  3.01µs ± 1%  -2.03%  (p=0.003 n=10+9)
IndexAnyASCII/4096:1           45.8µs ± 3%  45.9µs ± 2%    ~     (p=0.905 n=10+9)
IndexAnyASCII/4096:2           46.7µs ± 3%  46.2µs ± 3%    ~     (p=0.190 n=10+10)
IndexAnyASCII/4096:4           45.7µs ± 2%  46.4µs ± 3%  +1.37%  (p=0.022 n=9+10)
IndexAnyASCII/4096:8           46.4µs ± 3%  46.0µs ± 2%    ~     (p=0.436 n=10+10)
IndexAnyASCII/4096:16          46.6µs ± 3%  46.7µs ± 2%    ~     (p=0.971 n=10+10)
IndexPeriodic/IndexPeriodic2   1.40ms ± 3%  1.40ms ± 2%    ~     (p=0.853 n=10+10)
IndexPeriodic/IndexPeriodic4   1.40ms ± 3%  1.40ms ± 3%    ~     (p=0.579 n=10+10)
IndexPeriodic/IndexPeriodic8   1.42ms ± 3%  1.39ms ± 2%  -1.60%  (p=0.029 n=10+10)
IndexPeriodic/IndexPeriodic16   616µs ± 5%   583µs ± 5%  -5.32%  (p=0.001 n=10+10)
IndexPeriodic/IndexPeriodic32   313µs ± 5%   301µs ± 2%  -3.67%  (p=0.002 n=10+10)
IndexPeriodic/IndexPeriodic64   169µs ± 5%   164µs ± 5%  -3.17%  (p=0.023 n=10+10)

NodeJS version - 10.2.1

Change-Id: I9a8268314b5652c4aeffc4c5c72d2fd1a384aa9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/169777
Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-03-29 03:59:19 +00:00
..
bytealg internal/bytealg: simplify memchr for wasm 2019-03-29 03:59:19 +00:00
cpu internal/cpu: change s390x API to match x/sys/cpu 2019-02-28 13:46:45 +00:00
errinternal fmt: make type of fmt.Errorf the same as that of errors.New 2019-03-14 09:45:22 +00:00
fmtsort fmtsort: sort interfaces deterministically 2019-02-28 21:09:49 +00:00
goroot all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
lazyregexp internal/lazytemplate: add a lazy template wrapper 2019-02-27 23:49:01 +00:00
lazytemplate internal/lazytemplate: add a lazy template wrapper 2019-02-27 23:49:01 +00:00
nettrace
oserror os: make errors.Is work with ErrPermission et al. 2019-03-20 16:02:01 +00:00
poll runtime, internal/poll: report only critical event scanning error 2019-03-19 08:30:50 +00:00
race
reflectlite sort, internal/reflectlite: flesh out reflectlite enough for use by sort 2019-03-27 04:58:23 +00:00
singleflight
syscall os: make Readlink work with symlinks with target like \??\Volume{ABCD}\ 2019-03-01 07:44:37 +00:00
testenv internal/testenv: remove SetModVendor 2019-03-08 23:40:24 +00:00
testlog
trace cmd/trace: revert internal/traceparser 2018-11-22 02:59:55 +00:00
xcoff all: fix typos as reported by 'misspell' 2019-02-26 23:02:05 +00:00