mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 17:14:20 +01:00
bindings/javascript: Improve benchmark
This commit is contained in:
@@ -8,11 +8,15 @@ db.exec("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)");
|
||||
db.exec("INSERT INTO users (id, name, email) VALUES (1, 'Alice', 'alice@example.org')");
|
||||
|
||||
const stmt = db.prepare("SELECT * FROM users WHERE id = ?");
|
||||
const rawStmt = db.prepare("SELECT * FROM users WHERE id = ?").raw();
|
||||
|
||||
group('Statement', () => {
|
||||
bench('Statement.get() bind parameters', () => {
|
||||
bench('Statement.get() with bind parameters [expanded]', () => {
|
||||
stmt.get(1);
|
||||
});
|
||||
bench('Statement.get() with bind parameters [raw]', () => {
|
||||
rawStmt.get(1);
|
||||
});
|
||||
});
|
||||
|
||||
await run({
|
||||
|
||||
Reference in New Issue
Block a user