diff options
author | EuAndreh <eu@euandre.org> | 2024-10-18 17:54:26 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-10-20 03:36:18 -0300 |
commit | f00c41fd4e6af8cd0db80c118a3bb4abef09604e (patch) | |
tree | 46ad14d55cfe591691cf214076e8aea81edbfe18 /tests/benchmarks/query | |
parent | .gitignore: Remove .so (diff) | |
download | golite-f00c41fd4e6af8cd0db80c118a3bb4abef09604e.tar.gz golite-f00c41fd4e6af8cd0db80c118a3bb4abef09604e.tar.xz |
Shoehorn project into default golang skeleton structure
Diffstat (limited to 'tests/benchmarks/query')
-rw-r--r-- | tests/benchmarks/query/acudego.go | 42 | ||||
l--------- | tests/benchmarks/query/main.go | 1 |
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/benchmarks/query/acudego.go b/tests/benchmarks/query/acudego.go new file mode 100644 index 0000000..3386576 --- /dev/null +++ b/tests/benchmarks/query/acudego.go @@ -0,0 +1,42 @@ +package acudego + +import ( + "database/sql" + "flag" +) + + + +var nFlag = flag.Int( + "n", + 100_000, + "The number of iterations to execute", +) + +func MainTest() { + flag.Parse() + n := *nFlag + + db, err := sql.Open(DriverName, "file:benchdb?mode=memory&cache=shared") + if err != nil { + panic(err) + } + + var ( + S sql.NullString + I int + f float64 + s string + ) + for i := 0; i < n; i++ { + err = db.QueryRow("SELECT NULL, 1, 1.1, 'string';").Scan( + &S, + &I, + &f, + &s, + ) + if err != nil { + panic(err) + } + } +} diff --git a/tests/benchmarks/query/main.go b/tests/benchmarks/query/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/benchmarks/query/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file |