Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dev committed Feb 18, 2024
1 parent d481450 commit baf2fe2
Show file tree
Hide file tree
Showing 12 changed files with 439 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ node_modules/

# build directory
/dist/

*.db*
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ run:
# disable inlining
go test -benchmem -bench=. -gcflags '-l' github.com/skerkour/go-benchmarks/cgo
go test -benchmem -bench=. github.com/skerkour/go-benchmarks/encoding
go test -cpu=5000 -bench=. github.com/skerkour/go-benchmarks/pointer_swap

.PHONY: run_docker
run_docker:
Expand Down
2 changes: 1 addition & 1 deletion encoding/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"fmt"
"testing"

stdxbase32 "git.sr.ht/~pingoo/stdx/base32"
akamenskybase58 "github.com/akamensky/base58"
stdxbase32 "github.com/bloom42/stdx/base32"
mrtronbase58 "github.com/mr-tron/base58"
"github.com/skerkour/go-benchmarks/utils"
)
Expand Down
8 changes: 4 additions & 4 deletions encryption_aead/encryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"fmt"
"testing"

"git.sr.ht/~pingoo/stdx/crypto/bchacha20blake3"
"git.sr.ht/~pingoo/stdx/crypto/chacha20"
"git.sr.ht/~pingoo/stdx/crypto/chacha20blake3"
"git.sr.ht/~pingoo/stdx/crypto/schacha20blake3"
"github.com/bloom42/stdx/crypto/bchacha20blake3"
"github.com/bloom42/stdx/crypto/chacha20"
"github.com/bloom42/stdx/crypto/chacha20blake3"
"github.com/bloom42/stdx/crypto/schacha20blake3"
"github.com/skerkour/go-benchmarks/utils"
"golang.org/x/crypto/chacha20poly1305"
)
Expand Down
4 changes: 2 additions & 2 deletions encryption_unauthenticated/encryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"testing"

"git.sr.ht/~pingoo/stdx/crypto/chacha"
"git.sr.ht/~pingoo/stdx/crypto/chacha20"
"github.com/bloom42/stdx/crypto/chacha"
"github.com/bloom42/stdx/crypto/chacha20"
"github.com/skerkour/go-benchmarks/utils"
"golang.org/x/crypto/chacha20poly1305"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.22
toolchain go1.22.0

require (
git.sr.ht/~pingoo/stdx v0.0.0-20240217105719-1fd78f676abd
github.com/DataDog/zstd v1.5.5
github.com/akamensky/base58 v0.0.0-20210829145138-ce8bf8802e8f
github.com/bloom42/stdx v0.0.0-20240218143014-e4c67700e2a4
github.com/cespare/xxhash/v2 v2.2.0
github.com/golang/snappy v0.0.4
github.com/google/uuid v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
git.sr.ht/~pingoo/stdx v0.0.0-20240217105719-1fd78f676abd h1:U+GKt+LdItrnZ2ecv5ZRrVyidm3YorMWLKAXkwNI6GM=
git.sr.ht/~pingoo/stdx v0.0.0-20240217105719-1fd78f676abd/go.mod h1:Ms7ttIDy+TIfF2khURNDiOVEVgxhMbUoaXf0+MxUqgM=
github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=
github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/akamensky/base58 v0.0.0-20210829145138-ce8bf8802e8f h1:z8MkSJCUyTmW5YQlxsMLBlwA7GmjxC7L4ooicxqnhz8=
github.com/akamensky/base58 v0.0.0-20210829145138-ce8bf8802e8f/go.mod h1:UdUwYgAXBiL+kLfcqxoQJYkHA/vl937/PbFhZM34aZs=
github.com/bloom42/stdx v0.0.0-20240218143014-e4c67700e2a4 h1:MUjoNZoxFWXSIG3sOqgt5EBm9KyFHolBPuoAD3TllF8=
github.com/bloom42/stdx v0.0.0-20240218143014-e4c67700e2a4/go.mod h1:05zc5Smz6IZebUjC6ejRZ4s6BuMjW0yi1rHdWYKr96s=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
Expand Down
2 changes: 1 addition & 1 deletion kdf/kdf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"testing"

"git.sr.ht/~pingoo/stdx/crypto/chacha20"
"github.com/bloom42/stdx/crypto/chacha20"
"github.com/skerkour/go-benchmarks/utils"
zeeboblake3 "github.com/zeebo/blake3"
"golang.org/x/crypto/hkdf"
Expand Down
50 changes: 50 additions & 0 deletions pointer_swap/swap_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package swap

import (
"sync"
"sync/atomic"
"testing"
"unsafe"
)

func BenchmarkParallelAtomicPointerRead(b *testing.B) {
var ptr unsafe.Pointer
data := make(map[int]int)
data[1] = 1
atomic.StorePointer(&ptr, unsafe.Pointer(&data))

b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
localData := (*map[int]int)(atomic.LoadPointer(&ptr))
_ = (*localData)[1]
}
})
}

func BenchmarkParallelAtomicValueRead(b *testing.B) {
var ptr atomic.Value
data := make(map[int]int)
data[1] = 1
ptr.Store(data)

b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
localData := ptr.Load().(map[int]int)
_ = localData[1]
}
})
}

func BenchmarkParallelRWMutexRead(b *testing.B) {
var mutex sync.RWMutex
data := make(map[int]int)
data[1] = 1

b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
mutex.RLock()
_ = data[1]
mutex.RUnlock()
}
})
}
Loading

0 comments on commit baf2fe2

Please sign in to comment.