Skip to content

Instantly share code, notes, and snippets.

View percybolmer's full-sized avatar

ProgrammingPercy percybolmer

View GitHub Profile
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)
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)
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)
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)
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
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
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
# ---------------------------------------------------------------------------
# "OrdererOrgs" - Definition of organizations managing orderer nodes
# ---------------------------------------------------------------------------
OrdererOrgs:
# ---------------------------------------------------------------------------
# Orderer
# ---------------------------------------------------------------------------
- Name: Orderer
Domain: catblock.com
EnableNodeOUs: true
# 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:
package main
import "fmt"
func main() {
fmt.Println("Git action Ye")
}