fix: 将 libsql-client-go 作为普通目录提交,而非 gitlink
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package sqliteparserutils
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkSplitStatement(b *testing.B) {
|
||||
var (
|
||||
mem runtime.MemStats
|
||||
count = 8192
|
||||
)
|
||||
|
||||
hugeStatement := strings.Repeat("INSERT INTO t VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);", count)
|
||||
for i := 0; i < b.N; i++ {
|
||||
statements, _ := SplitStatement(hugeStatement)
|
||||
if len(statements) != count {
|
||||
b.Fail()
|
||||
}
|
||||
// these intermediate logs can help to estimate memory working set (instead of total allocations)
|
||||
runtime.ReadMemStats(&mem)
|
||||
b.Logf("heap in use: %v", mem.HeapInuse)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user