LGTM On Wed, Sep 10, 2014 at 9:07 PM, <khr@golang.org> wrote: > Reviewers: iant, > ...
10 years, 6 months ago
(2014-09-11 04:13:52 UTC)
#2
LGTM
On Wed, Sep 10, 2014 at 9:07 PM, <khr@golang.org> wrote:
> Reviewers: iant,
>
> Message:
> Hello iant@golang.org (cc: golang-codereviews@googlegroups.com),
>
> I'd like you to review this change to
> https://code.google.com/p/go/
>
>
> Description:
> runtime: add timing test for iterate/delete map idiom.
>
> Please review this at https://codereview.appspot.com/140510043/
>
> Affected files (+18, -0 lines):
> M test/maplinear.go
>
>
> Index: test/maplinear.go
> ===================================================================
> --- a/test/maplinear.go
> +++ b/test/maplinear.go
> @@ -140,4 +140,22 @@
> m[complex(float64(i), float64(i))] = 1
> }
> })
> +
> + // ~70ms on a 1.6GHz Zeon.
> + // The iterate/delete idiom currently takes expected
> + // O(n lg n) time. Fortunately, the checkLinear test
> + // leaves enough wiggle room to include n lg n time
> + // (it actually tests for O(n^log_2(3)).
> + checkLinear("iterdelete", 10000, func(n int) {
> + m := map[int]int{}
> + for i := 0; i < n; i++ {
> + m[i] = i
> + }
> + for i := 0; i < n; i++ {
> + for k := range m {
> + delete(m, k)
> + break
> + }
> + }
> + })
> }
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-codereviews" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-codereviews+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
This test just failed on the linux-amd64 builder: http://build.golang.org/log/a072ace9911212c913e018a36fd28e0bbdd17200. Maybe there wasn't enough wiggle room ...
10 years, 6 months ago
(2014-09-12 01:24:38 UTC)
#5
Issue 140510043: code review 140510043: runtime: add timing test for iterate/delete map idiom.
(Closed)
Created 10 years, 6 months ago by khr
Modified 10 years, 6 months ago
Reviewers: josharian
Base URL:
Comments: 0