diff options
author | Chris Wendt <chrismwendt@gmail.com> | 2022-06-08 03:16:02 -0600 |
---|---|---|
committer | Chris Wendt <chrismwendt@gmail.com> | 2022-06-08 03:16:02 -0600 |
commit | 2ef3a53065a49ba3238203484588f1f72ccf25fd (patch) | |
tree | 2f59b6ef96aee1ec7ffd26c2793dc61ddb1142cb /bench_test.go | |
parent | update README (diff) | |
download | stm-2ef3a53065a49ba3238203484588f1f72ccf25fd.tar.gz stm-2ef3a53065a49ba3238203484588f1f72ccf25fd.tar.xz |
remove unnecessary type parameters
Diffstat (limited to 'bench_test.go')
-rw-r--r-- | bench_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bench_test.go b/bench_test.go index 0b84715..0d40caf 100644 --- a/bench_test.go +++ b/bench_test.go @@ -8,14 +8,14 @@ import ( ) func BenchmarkAtomicGet(b *testing.B) { - x := NewVar[int](0) + x := NewVar(0) for i := 0; i < b.N; i++ { AtomicGet(x) } } func BenchmarkAtomicSet(b *testing.B) { - x := NewVar[int](0) + x := NewVar(0) for i := 0; i < b.N; i++ { AtomicSet(x, 0) } @@ -24,7 +24,7 @@ func BenchmarkAtomicSet(b *testing.B) { func BenchmarkIncrementSTM(b *testing.B) { for i := 0; i < b.N; i++ { // spawn 1000 goroutines that each increment x by 1 - x := NewVar[int](0) + x := NewVar(0) for i := 0; i < 1000; i++ { go Atomically(VoidOperation(func(tx *Tx) { cur := x.Get(tx) @@ -83,7 +83,7 @@ func BenchmarkReadVarSTM(b *testing.B) { for i := 0; i < b.N; i++ { var wg sync.WaitGroup wg.Add(1000) - x := NewVar[int](0) + x := NewVar(0) for i := 0; i < 1000; i++ { go func() { AtomicGet(x) |