aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmarks/value-store/stm.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-01-23 09:54:11 -0300
committerEuAndreh <eu@euandre.org>2025-01-23 11:36:44 -0300
commit5f6607152a96b85f1518028b8f1ee1ef1aefda75 (patch)
treebe54946ddb2510a317322a2660563c83cab2117c /tests/benchmarks/value-store/stm.go
parenttests/stm.go: Turn example into functional test (diff)
downloadstm-5f6607152a96b85f1518028b8f1ee1ef1aefda75.tar.gz
stm-5f6607152a96b85f1518028b8f1ee1ef1aefda75.tar.xz
Move benchmarks from tests/stm.go to tests/benchmarks/*
Diffstat (limited to 'tests/benchmarks/value-store/stm.go')
-rw-r--r--tests/benchmarks/value-store/stm.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/benchmarks/value-store/stm.go b/tests/benchmarks/value-store/stm.go
new file mode 100644
index 0000000..0d85750
--- /dev/null
+++ b/tests/benchmarks/value-store/stm.go
@@ -0,0 +1,24 @@
+package stm
+
+import (
+ "flag"
+ "fmt"
+)
+
+
+
+var nFlag = flag.Int(
+ "n",
+ 1_000,
+ "The number of iterations to execute",
+)
+
+func MainTest() {
+ flag.Parse()
+ n := *nFlag
+
+ v := New("hello")
+ for i := 0; i < n; i++ {
+ v.Store(fmt.Sprint(i))
+ }
+}