Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(788)

Issue 8853048: code review 8853048: runtime/bytes: fast Compare for byte arrays and strings. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by khr
Modified:
11 years ago
Reviewers:
CC:
bradfitz, julienschmidt, golang-dev
Visibility:
Public.

Description

runtime/bytes: fast Compare for byte arrays and strings. Uses SSE instructions to process 16 bytes at a time. fixes issue 5354

Patch Set 1 #

Patch Set 2 : diff -r 1d49ee511d95 https://code.google.com/p/go #

Total comments: 1

Patch Set 3 : diff -r 1d49ee511d95 https://code.google.com/p/go #

Patch Set 4 : diff -r 1d49ee511d95 https://code.google.com/p/go #

Patch Set 5 : diff -r 1d49ee511d95 https://code.google.com/p/go #

Patch Set 6 : diff -r 8efe0c9d6a0d https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 7 : diff -r 8efe0c9d6a0d https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 8 : diff -r 8efe0c9d6a0d https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 9 : diff -r 00d69aa6619e https://khr%40golang.org@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+568 lines, -64 lines) Patch
M src/cmd/dist/goc2c.c View 1 2 3 4 5 6 1 chunk +15 lines, -3 lines 0 comments Download
M src/pkg/bytes/bytes.go View 1 1 chunk +0 lines, -26 lines 0 comments Download
M src/pkg/bytes/bytes_decl.go View 1 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M src/pkg/bytes/bytes_test.go View 1 2 3 4 5 3 chunks +3 lines, -7 lines 0 comments Download
A src/pkg/bytes/compare_test.go View 1 2 3 4 5 1 chunk +204 lines, -0 lines 0 comments Download
M src/pkg/runtime/asm_386.s View 1 2 3 4 1 chunk +135 lines, -0 lines 0 comments Download
M src/pkg/runtime/asm_amd64.s View 1 2 3 4 1 chunk +131 lines, -0 lines 0 comments Download
A src/pkg/runtime/noasm_arm.goc View 1 2 3 4 5 6 1 chunk +73 lines, -0 lines 0 comments Download
M src/pkg/runtime/string.goc View 1 1 chunk +0 lines, -28 lines 0 comments Download

Messages

Total messages: 9
bradfitz
Using +build tags to keep the strings.goc + bytes Portable implementations for !amd64 isn't incredibly ...
11 years ago (2013-04-28 05:40:55 UTC) #1
julienschmidt
A few benchmark results: OLD BenchmarkCompareBytesEqual 50000000 39.7 ns/op BenchmarkCompareBytesToNil 500000000 7.04 ns/op BenchmarkCompareBytesEmpty 200000000 ...
11 years ago (2013-04-28 13:09:58 UTC) #2
julienschmidt
SEE ASM = SSE ASM (by khr)
11 years ago (2013-04-28 13:12:35 UTC) #3
julienschmidt
The amd64 assembly looks fine to me so far https://codereview.appspot.com/8853048/diff/2001/src/pkg/bytes/bytes_decl.go File src/pkg/bytes/bytes_decl.go (right): https://codereview.appspot.com/8853048/diff/2001/src/pkg/bytes/bytes_decl.go#newcode17 src/pkg/bytes/bytes_decl.go:17: ...
11 years ago (2013-04-28 14:00:56 UTC) #4
khr
Cleaned up and ready to check in. Care for a final look? On 2013/04/28 14:00:56, ...
11 years ago (2013-05-14 18:38:39 UTC) #5
julienschmidt
On 2013/05/14 18:38:39, khr wrote: > Care for a final look? Yes. LGTM
11 years ago (2013-05-14 18:57:02 UTC) #6
bradfitz
LGTM On Tue, May 14, 2013 at 11:38 AM, <khr@golang.org> wrote: > Reviewers: bradfitz, julienschmidt, ...
11 years ago (2013-05-14 19:06:26 UTC) #7
khr
Hello bradfitz@golang.org, google@julienschmidt.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://khr%40golang.org@code.google.com/p/go/
11 years ago (2013-05-14 23:05:49 UTC) #8
khr
11 years ago (2013-05-14 23:05:54 UTC) #9
*** Submitted as https://code.google.com/p/go/source/detail?r=b2f1f8cb2fcb ***

runtime/bytes: fast Compare for byte arrays and strings.

Uses SSE instructions to process 16 bytes at a time.

fixes issue 5354

R=bradfitz, google
CC=golang-dev
https://codereview.appspot.com/8853048
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b