runtime: do hashmap grow work during reads.
Before this change, grow work was done only
during map writes to ensure multithreaded safety.
This can lead to maps remaining in a partially
grown state for a long time, potentially forever.
This change allows grow work to happen during reads,
which will lead to grow work finishing sooner, making
the resulting map smaller and faster.
Grow work is not done in parallel. Reads can
happen in parallel while grow work is happening.
LGTM I never looked at hashmap code closely before, so I am not skilled to ...
12 years, 1 month ago
(2013-05-31 05:31:08 UTC)
#6
LGTM
I never looked at hashmap code closely before, so I am not skilled to review
this in all details. But I understand what you are doing.
If you are sure in this and all.bash passes, I think you can submit. Or
otherwise wait for another review.
On Fri, May 31, 2013 at 5:05 PM, <iant@golang.org> wrote: > LGTM > > > ...
12 years, 1 month ago
(2013-06-01 03:55:41 UTC)
#8
On Fri, May 31, 2013 at 5:05 PM, <iant@golang.org> wrote:
> LGTM
>
>
> https://codereview.appspot.**com/8852047/diff/27001/src/**
>
pkg/runtime/hashmap.c<https://codereview.appspot.com/8852047/diff/27001/src/pkg/runtime/hashmap.c>
> File src/pkg/runtime/hashmap.c (right):
>
> https://codereview.appspot.**com/8852047/diff/27001/src/**
>
pkg/runtime/hashmap.c#**newcode120<https://codereview.appspot.com/8852047/diff/27001/src/pkg/runtime/hashmap.c#newcode120>
> src/pkg/runtime/hashmap.c:120: CanFreeBucket = 16, // ok to free buckets
> As far as I can tell the CanFreeBucket flag is no longer used. It seems
> that the code never free buckets and always relies on the GC. Which is
> fine.
>
>
Yes, I added a TODO to clean this up.
> https://codereview.appspot.**com/8852047/diff/27001/src/**
>
pkg/runtime/hashmap.c#**newcode407<https://codereview.appspot.com/8852047/diff/27001/src/pkg/runtime/hashmap.c#newcode407>
> src/pkg/runtime/hashmap.c:407: // Ensure that bucket has been evacuated
> from oldbucket so that we can modify it.
> s/oldbucket/oldbuckets/ ?
>
>
Done.
>
https://codereview.appspot.**com/8852047/<https://codereview.appspot.com/8852...
>
*** Submitted as https://code.google.com/p/go/source/detail?r=26a3b2e4cdfe *** runtime: do hashmap grow work during reads. Before this change, ...
12 years, 1 month ago
(2013-06-01 03:58:34 UTC)
#9
*** Submitted as https://code.google.com/p/go/source/detail?r=26a3b2e4cdfe ***
runtime: do hashmap grow work during reads.
Before this change, grow work was done only
during map writes to ensure multithreaded safety.
This can lead to maps remaining in a partially
grown state for a long time, potentially forever.
This change allows grow work to happen during reads,
which will lead to grow work finishing sooner, making
the resulting map smaller and faster.
Grow work is not done in parallel. Reads can
happen in parallel while grow work is happening.
R=golang-dev, dvyukov, khr, iant
CC=golang-dev
https://codereview.appspot.com/8852047
Issue 8852047: code review 8852047: runtime: do hashmap grow work during reads.
(Closed)
Created 12 years, 2 months ago by khr
Modified 12 years, 1 month ago
Reviewers:
Base URL:
Comments: 4