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

Issue 99380043: code review 99380043: runtime: convert map implementation to Go. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 11 months ago by khr
Modified:
9 years, 8 months ago
Reviewers:
gobot, rsc
CC:
golang-codereviews, dave_cheney.net, dvyukov, rsc, khr1
Visibility:
Public.

Description

runtime: convert map implementation to Go. It's a bit slower, but not painfully so. There is still room for improvement (saving space so we can use nosplit, and removing the requirement for hash/eq stubs). benchmark old ns/op new ns/op delta BenchmarkMegMap 23.5 24.2 +2.98% BenchmarkMegOneMap 14.9 15.7 +5.37% BenchmarkMegEqMap 71668 72234 +0.79% BenchmarkMegEmptyMap 4.05 4.93 +21.73% BenchmarkSmallStrMap 21.9 22.5 +2.74% BenchmarkMapStringKeysEight_16 23.1 26.3 +13.85% BenchmarkMapStringKeysEight_32 21.9 25.0 +14.16% BenchmarkMapStringKeysEight_64 21.9 25.1 +14.61% BenchmarkMapStringKeysEight_1M 21.9 25.0 +14.16% BenchmarkIntMap 21.8 12.5 -42.66% BenchmarkRepeatedLookupStrMapKey32 39.3 30.2 -23.16% BenchmarkRepeatedLookupStrMapKey1M 322353 322675 +0.10% BenchmarkNewEmptyMap 129 136 +5.43% BenchmarkMapIter 137 107 -21.90% BenchmarkMapIterEmpty 7.14 8.71 +21.99% BenchmarkSameLengthMap 5.24 6.82 +30.15% BenchmarkBigKeyMap 34.5 35.3 +2.32% BenchmarkBigValMap 36.1 36.1 +0.00% BenchmarkSmallKeyMap 26.9 26.7 -0.74%

Patch Set 1 #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Total comments: 14

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

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

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

Total comments: 3

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+1848 lines, -1397 lines) Patch
M src/cmd/api/goapi.go View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download
M src/cmd/dist/buildruntime.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +2 lines, -0 lines 0 comments Download
M src/cmd/ld/dwarf.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/reflect/asm_386.s View 1 2 3 4 5 6 7 8 9 10 1 chunk +21 lines, -0 lines 0 comments Download
M src/pkg/reflect/asm_amd64.s View 1 2 3 4 5 6 7 1 chunk +21 lines, -0 lines 0 comments Download
M src/pkg/reflect/asm_amd64p32.s View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +21 lines, -0 lines 0 comments Download
M src/pkg/reflect/asm_arm.s View 1 2 3 4 5 6 7 8 9 10 1 chunk +21 lines, -0 lines 0 comments Download
M src/pkg/runtime/alg.goc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +3 lines, -0 lines 0 comments Download
M src/pkg/runtime/asm_386.s View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +86 lines, -0 lines 0 comments Download
M src/pkg/runtime/asm_amd64.s View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +86 lines, -0 lines 0 comments Download
M src/pkg/runtime/asm_amd64p32.s View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +88 lines, -2 lines 0 comments Download
M src/pkg/runtime/asm_arm.s View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +93 lines, -0 lines 0 comments Download
M src/pkg/runtime/defs.c View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/export_test.go View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
R src/pkg/runtime/hashmap.h View 1 2 3 1 chunk +0 lines, -147 lines 0 comments Download
M src/pkg/runtime/hashmap.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +867 lines, -980 lines 0 comments Download
M src/pkg/runtime/hashmap_fast.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +366 lines, -208 lines 0 comments Download
M src/pkg/runtime/malloc.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/memmove_386.s View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/memmove_amd64.s View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -1 line 0 comments Download
A src/pkg/runtime/mprof.h View 1 2 3 4 5 6 1 chunk +56 lines, -0 lines 0 comments Download
M src/pkg/runtime/mprof.goc View 1 2 3 2 chunks +1 line, -52 lines 0 comments Download
M src/pkg/runtime/race.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +20 lines, -0 lines 0 comments Download
M src/pkg/runtime/race0.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +7 lines, -0 lines 0 comments Download
M src/pkg/runtime/string.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/stubs.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +54 lines, -0 lines 0 comments Download
M src/pkg/runtime/stubs.goc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 17
khr
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://khr%40golang.org@code.google.com/p/go/
9 years, 10 months ago (2014-06-18 00:09:41 UTC) #1
dave_cheney.net
This is great. I have some very minor comments, please feel free to ignore them ...
9 years, 10 months ago (2014-06-18 05:41:13 UTC) #2
dvyukov
https://codereview.appspot.com/99380043/diff/400001/src/pkg/runtime/hashmap.go File src/pkg/runtime/hashmap.go (right): https://codereview.appspot.com/99380043/diff/400001/src/pkg/runtime/hashmap.go#newcode156 src/pkg/runtime/hashmap.go:156: remove empty line
9 years, 10 months ago (2014-06-18 16:22:56 UTC) #3
dave_cheney.net
On 2014/06/18 16:22:56, dvyukov wrote: > https://codereview.appspot.com/99380043/diff/400001/src/pkg/runtime/hashmap.go > File src/pkg/runtime/hashmap.go (right): > > https://codereview.appspot.com/99380043/diff/400001/src/pkg/runtime/hashmap.go#newcode156 > ...
9 years, 10 months ago (2014-06-19 01:51:48 UTC) #4
dave_cheney.net
ping. Could you please hg mail this again so it applys cleanly.
9 years, 10 months ago (2014-06-27 03:07:51 UTC) #5
rsc
Looks good. I didn't read hashmap.go closely - waiting for the diff view. https://codereview.appspot.com/99380043/diff/400001/src/pkg/reflect/asm_386.s File ...
9 years, 10 months ago (2014-06-27 16:50:43 UTC) #6
khr
Hello golang-codereviews@googlegroups.com, dave@cheney.net, dvyukov@google.com, rsc@golang.org (cc: golang-codereviews@googlegroups.com), Please take another look.
9 years, 10 months ago (2014-06-29 02:01:59 UTC) #7
dave_cheney.net
Tests pass on linux/arm Results are not great on 5g BenchmarkMegMap 269 349 +29.74% BenchmarkMegOneMap ...
9 years, 10 months ago (2014-06-30 09:28:10 UTC) #8
rsc
LGTM https://codereview.appspot.com/99380043/diff/460001/src/pkg/runtime/hashmap.go File src/pkg/runtime/hashmap.go (right): https://codereview.appspot.com/99380043/diff/460001/src/pkg/runtime/hashmap.go#newcode185 src/pkg/runtime/hashmap.go:185: panic("bucketsize wrong") I can't decide if I should ...
9 years, 10 months ago (2014-06-30 15:37:20 UTC) #9
dave_cheney.net
> https://codereview.appspot.com/99380043/diff/460001/src/pkg/runtime/hashmap.go#newcode185 > src/pkg/runtime/hashmap.go:185: panic("bucketsize wrong") > I can't decide if I should worry that ...
9 years, 10 months ago (2014-06-30 22:33:49 UTC) #10
gobot
R=rsc@golang.org (assigned by dave@cheney.net)
9 years, 10 months ago (2014-07-01 05:32:25 UTC) #11
dvyukov
https://codereview.appspot.com/99380043/diff/460001/src/pkg/runtime/hashmap.go File src/pkg/runtime/hashmap.go (right): https://codereview.appspot.com/99380043/diff/460001/src/pkg/runtime/hashmap.go#newcode185 src/pkg/runtime/hashmap.go:185: panic("bucketsize wrong") On 2014/06/30 15:37:20, rsc wrote: > I ...
9 years, 10 months ago (2014-07-01 05:57:05 UTC) #12
dave_cheney.net
On Tue, Jul 1, 2014 at 3:57 PM, <dvyukov@google.com> wrote: > > https://codereview.appspot.com/99380043/diff/460001/src/pkg/runtime/hashmap.go > File ...
9 years, 10 months ago (2014-07-01 06:02:44 UTC) #13
khr1
On Mon, Jun 30, 2014 at 8:37 AM, <rsc@golang.org> wrote: > LGTM > > > ...
9 years, 9 months ago (2014-07-02 15:13:43 UTC) #14
khr
*** Submitted as https://code.google.com/p/go/source/detail?r=27de92961f3e *** runtime: convert map implementation to Go. It's a bit slower, ...
9 years, 9 months ago (2014-07-16 21:16:32 UTC) #15
gobot
This CL appears to have broken the nacl-amd64p32 builder. See http://build.golang.org/log/49c10120b5000e37ba395be5d5ad7a651506c449
9 years, 9 months ago (2014-07-16 21:39:45 UTC) #16
dave_cheney.net
9 years, 9 months ago (2014-07-16 21:45:35 UTC) #17
This is a real failure. I've raised
https://code.google.com/p/go/issues/detail?id=8378


On Thu, Jul 17, 2014 at 7:39 AM, <gobot@golang.org> wrote:

> This CL appears to have broken the nacl-amd64p32 builder.
> See http://build.golang.org/log/49c10120b5000e37ba395be5d5ad7a651506c449
>
> https://codereview.appspot.com/99380043/
>
Sign in to reply to this message.

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