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

Side by Side Diff: test/bench/go/asop_test.go

Issue 6819087: code review 6819087: test/bench/go: new package (Closed)
Patch Set: diff -r 2b08c2106305 https://code.google.com/p/go Created 11 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/bench/go/div_test.go » ('j') | test/bench/go/doc.go » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package bench
6
7 import "testing"
8
9 func BenchmarkLSL(b *testing.B) {
r 2012/11/07 16:12:40 it seems if you have these, you might as well fini
dfc 2012/11/08 01:20:34 Done.
10 for i, v := 0, 0; i < b.N; i++ {
11 v <<= 1
12 }
rsc 2012/11/07 14:25:40 I would suggest add a global var x int and then
dfc 2012/11/08 01:20:34 Done.
13 }
14
15 func BenchmarkLSR(b *testing.B) {
16 for i, v := 0, 0; i < b.N; i++ {
17 v >>= 1
18 }
19 }
20
21 func BenchmarkOREQ(b *testing.B) {
22 for i, v := 0, 0; i < b.N; i++ {
23 v |= 1
24 }
25 }
26
27 func BenchmarkANDEQ(b *testing.B) {
28 for i, v := 0, 0; i < b.N; i++ {
29 v &= 1
30 }
31 }
32
33 func BenchmarkDiv2(b *testing.B) {
34 for i, v := 0, 0; i < b.N; i++ {
35 v /= 2
36 }
37 }
OLDNEW
« no previous file with comments | « no previous file | test/bench/go/div_test.go » ('j') | test/bench/go/doc.go » ('J')

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