This file contains hidden or 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 benching | |
import ( | |
"testing" | |
) | |
// insertXIntSlice is used to add X amount of items into a []int | |
func insertXIntSlice(x int, b *testing.B) { | |
// Initalize a Slice and insert X amount of Items | |
testSlice := make([]int, 0) |
This file contains hidden or 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 benching | |
import ( | |
"testing" | |
) | |
// insertXPreallocIntSlice is used to add X amount of items into a []int | |
func insertXPreallocIntSlice(x int, b *testing.B) { | |
// Initalize a Slice and insert X amount of Items | |
testSlice := make([]int, x) |
This file contains hidden or 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 benching | |
import ( | |
"testing" | |
) | |
// selectXIntMap is used to Select X amount of times from a map | |
func selectXIntMap(x int, b *testing.B) { | |
// Initialize Map and Insert X amount of items | |
testmap := make(map[int]int, x) |
This file contains hidden or 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 benching | |
import ( | |
"testing" | |
) | |
// selectXIntSlice is used to Select X amount of times from a Slice | |
func selectXIntSlice(x int, b *testing.B) { | |
// Initialize Slice and Insert X amount of items | |
testSlice := make([]int, x) |
This file contains hidden or 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 | Type | ns/op | B/op | allocs/op | Fixed-size | |
---|---|---|---|---|---|---|
Insert | Map[interface]int | 3730206 | 1318557 | 10380 | no | |
Insert | Map[int]int | 1632196 | 879007 | 381 | no | |
Insert | Map[int]int | 857588 | 1569 | 0 | yes | |
Insert | []int | 75388 | 451883 | 0 | no | |
Insert | []int | 7246 | 0 | 0 | yes | |
Select | Map[int]int | 507843 | 0 | 0 | yes | |
Select | []int | 2866 | 0 | 0 | yes |
This file contains hidden or 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 benching | |
import ( | |
"math/rand" | |
"testing" | |
"time" | |
) | |
// Create slices and Maps to use in benchmark so we dont have to recreate them each itteration | |
var userSlice10000 []User |
This file contains hidden or 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
Type | Users | ns/op | |
---|---|---|---|
Slice | 10000 | 1763 | |
Slice | 100000 | 72760 | |
Slice | 100000 | 140917 | |
Map | 10000 | 21.8 | |
Map | 100000 | 19.5 | |
Map | 100000 | 21.1 |
This file contains hidden or 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
# --------------------------------------------------------------------------- | |
# "OrdererOrgs" - Definition of organizations managing orderer nodes | |
# --------------------------------------------------------------------------- | |
OrdererOrgs: | |
# --------------------------------------------------------------------------- | |
# Orderer | |
# --------------------------------------------------------------------------- | |
- Name: Orderer | |
Domain: catblock.com | |
EnableNodeOUs: true |
This file contains hidden or 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
# This is a basic workflow to help you get started with Actions | |
name: build and test | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: |
This file contains hidden or 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 "fmt" | |
func main() { | |
fmt.Println("Git action Ye") | |
} |