aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmarks/vector-iterator-backward
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/vector-iterator-backward')
l---------tests/benchmarks/vector-iterator-backward/main.go1
-rw-r--r--tests/benchmarks/vector-iterator-backward/pds.go29
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/benchmarks/vector-iterator-backward/main.go b/tests/benchmarks/vector-iterator-backward/main.go
new file mode 120000
index 0000000..f67563d
--- /dev/null
+++ b/tests/benchmarks/vector-iterator-backward/main.go
@@ -0,0 +1 @@
+../../main.go \ No newline at end of file
diff --git a/tests/benchmarks/vector-iterator-backward/pds.go b/tests/benchmarks/vector-iterator-backward/pds.go
new file mode 100644
index 0000000..a03e138
--- /dev/null
+++ b/tests/benchmarks/vector-iterator-backward/pds.go
@@ -0,0 +1,29 @@
+package pds
+
+import (
+ "flag"
+)
+
+
+
+var nFlag = flag.Int(
+ "n",
+ 1_000,
+ "The number of iterations to execute",
+)
+
+func MainTest() {
+ flag.Parse()
+ n := *nFlag
+
+ l := NewVector[int]()
+ for i := 0; i < n; i++ {
+ l = l.Append(i)
+ }
+
+ itr := l.Iterator()
+ itr.Last()
+ for i := 0; i < n; i++ {
+ itr.Prev()
+ }
+}