This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Benchmark go 1.2 vs go 1.3: | |
name old time/op new time/op delta | |
JsonMarshall 1.91µs ± 2% 1.37µs ± 2% -28.23% (p=0.008 n=5+5) | |
JsonUnmarshal 2.70µs ± 2% 1.75µs ± 3% -35.18% (p=0.008 n=5+5) | |
name old alloc/op new alloc/op delta | |
JsonMarshall 221B ± 0% 218B ± 0% -1.36% (p=0.008 n=5+5) | |
JsonUnmarshal 518B ± 0% 475B ± 0% -8.37% (p=0.008 n=5+5) | |
name old allocs/op new allocs/op delta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package deck | |
import ( | |
"errors" | |
"math/rand" | |
) | |
var Empty = errors.New("Empty deck") | |
type Deck struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package deck | |
import ( | |
"fmt" | |
"github.com/stretchr/testify/assert" | |
"testing" | |
) | |
func TestDeckShouldBeShuffledOnce(t *testing.T) { | |
var num uint8 = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package deck | |
import ( | |
"testing" | |
) | |
func BenchmarkGC(b *testing.B) { | |
b.ReportAllocs() | |
shuffled := 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package deck_test | |
import ( | |
"github.com/blanchonvincent/test-package/card" | |
"github.com/stretchr/testify/assert" | |
"testing" | |
) | |
func TestDeckCanDrawCards(t *testing.T) { | |
var num uint8 = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"sync" | |
"time" | |
) | |
func main() { | |
c := make(chan string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"sync" | |
"time" | |
) | |
func main() { | |
c := make(chan string, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bench | |
import ( | |
"sync" | |
"sync/atomic" | |
"testing" | |
) | |
func BenchmarkWithNoBuffer(b *testing.B) { | |
benchmarkWithBuffer(b, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
_ "os" | |
) | |
func init() { | |
println(`init 1`) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func init() { | |
println(`init 3`) | |
} |
OlderNewer