Commit Graph

57 Commits

Author SHA1 Message Date
Pere Diaz Bou
ec2cff2026 benchmark: introduce simple 1 thread concurrent benchmark for mvcc/sqlite/wal
This is considerably simpler with 1 thread as we just try to yield
control when I/O happens and we only run io.run_once when all
connections tried to do some work. This allows connections to
cooperatively progress.
2025-09-12 14:02:57 +00:00
Piotr Rzysko
ab0f673f44 Add benchmark for result column expression handling
The new query combines multiple aggregate functions, plain columns,
arithmetic expressions, and aggregates wrapped in additional expressions.

Local run results:
```
Prepare `SELECT first_name, last_name, state, city, age + 10, LENGTH(email), UPPER(first_name), LOWE...
                        time:   [64.535 µs 64.623 µs 64.713 µs]
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe
```
2025-09-02 08:22:36 +02:00
Piotr Rzysko
40a8058083 Use mimalloc in benchmark.rs 2025-08-11 08:02:35 +02:00
Jussi Saurio
aea6d942d6 bench/insert: fix expected return value from pragma 2025-08-07 17:44:46 +03:00
Jussi Saurio
95c6c7581b bench/insert: use PRAGMA synchronous=full
synchronous=FULL means WAL is fsynced on every commit,
which is what we also do.

however we do not do the padding to sector alignment that
sqlite does (see #2450), which makes sqlite do more work
than we do.
2025-08-07 13:40:14 +03:00
Jussi Saurio
ff128e2f20 bench/insert: use locking_mode EXCLUSIVE and journal_mode=WAL for sqlite 2025-08-06 21:40:43 +03:00
Levy A.
3bc1001a93 feat(bench): complete ALTER TABLE benchmarks 2025-08-06 13:38:26 -03:00
Levy A.
b9a3a93ef0 fix: clippy 2025-08-02 20:06:05 -03:00
Levy A.
b14a11a2fd fix: change name for schema btree + fix benchmark 2025-08-02 17:17:36 -03:00
Levy A.
1e177053cb feat: add RenameTable instruction
direct schema mutation, no reparsing
2025-08-01 21:11:25 -03:00
Levy A.
cf91e36ed3 fix: force sqlite to parse schema on connection benchmark 2025-07-31 13:24:59 -03:00
Jussi Saurio
3a861e1618 bench: add insert benchmark (batch sizes: 1,10,100) 2025-07-15 13:41:56 +03:00
Nils Koch
828d4f5016 fix clippy errors for rust 1.88.0 (auto fix) 2025-07-12 18:58:41 +03:00
Levy A.
a479d0d5e8 prevent calling to_uppercase 2025-07-11 15:04:28 -03:00
Levy A.
9c0e850622 add connection benchmark 2025-07-11 15:04:24 -03:00
pedrocarlo
711b1ef114 make all run_once be run under statement or connection so that rollback is called 2025-07-07 11:51:25 -03:00
Pekka Enberg
9c1b7897ac Fix URLs to point to github.com/tursodatabase/turso 2025-06-30 11:23:53 +03:00
Pekka Enberg
53ba3ff926 Rename limbo_core crate to turso_core 2025-06-29 09:59:17 +03:00
Pekka Enberg
2fc5c0ce5c Switch to runtime flag for enabling indexes
Makes it easier to test the feature:

```
$ cargo run --  --experimental-indexes
Limbo v0.0.22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database
limbo> CREATE TABLE t(x);
limbo> CREATE INDEX t_idx ON t(x);
limbo> DROP INDEX t_idx;
```
2025-06-26 10:07:28 +03:00
pedrocarlo
7508043b62 add bench for select count 2025-05-10 22:23:01 -03:00
Pere Diaz Bou
13d518d086 fragment bench functions 2025-03-19 17:55:24 +01:00
Pekka Enberg
96175cccf7 cli: Add --experimental-mvcc option to enable MVCC 2025-03-06 10:16:42 +02:00
Pere Diaz Bou
8daf7666d1 Make database Sync + Send 2025-03-05 14:07:48 +01:00
Gustavo Sverzut Barbieri
cd2d817c10 github.com/penberg/limbo was moved to github.com/tursodatabase/limbo
Adjust all the references since they were broken
2025-02-08 10:21:49 -03:00
Pekka Enberg
c210821100 core: Move result row to ProgramState
Move result row to `ProgramState` to mimic what SQLite does where `Vdbe`
struct has a `pResultRow` member. This makes it easier to deal with result
lifetime, but more importantly, eventually lazily parse values at the edges of
the API.
2025-02-06 11:52:26 +02:00
Pekka Enberg
a045866a6c Merge 'core: Fix benchmark panic if syscall is interrupted' from Pekka Enberg
Fixes the following panics:
Benchmarking Execute `SELECT * FROM users LIMIT ?`/Limbo/100: Profiling
for 5.0000 sthread 'main' panicked at core/benches/benchmark.rs:69:43:
called `Result::unwrap()` on an `Err` value: IOError(Os { code: 4, kind:
Interrupted, message: "Interrupted system call" })
note: run with `RUST_BACKTRACE=1` environment variable to display a
backtrace

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #882
2025-02-04 18:25:34 +02:00
Pekka Enberg
097e56c19f core: Kill Statement::query() method
It's a pointless wrapper on top of `step()` that introduce additional
memory allocation and deallocation.
2025-02-04 13:46:11 +02:00
Pekka Enberg
7dbfdba59f core: Fix benchmark panic if syscall is interrupted
Fixes the following panics:

Benchmarking Execute `SELECT * FROM users LIMIT ?`/Limbo/100: Profiling for 5.0000 sthread 'main' panicked at core/benches/benchmark.rs:69:43:
called `Result::unwrap()` on an `Err` value: IOError(Os { code: 4, kind: Interrupted, message: "Interrupted system call" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2025-02-04 13:24:55 +02:00
Levy A.
5acd7a5ea8 side by side comparison with sqlite 2025-01-31 03:11:07 -03:00
Pekka Enberg
7967cc5efc core: Kill Rows wrapper struct
It's just an useless wrapper, kill it.
2025-01-26 16:27:19 +02:00
Jorge Hermo
15f7928551 chore: enable all features in clippy ci and fix more clippy lints 2025-01-15 23:23:12 +01:00
Jussi Saurio
f0b3bac435 add new more complex benchmark entry for preparing statement 2025-01-05 13:51:56 +02:00
Pekka Enberg
f2ecebc357 Rename RowResult to StepResult
The name "row result" is confusing because it really *is* a result from
a step() call. The only difference is how a row is represented as we
return from VDBE or from a statement.

Therefore, rename RowResult to StepResult.
2024-12-27 10:20:41 +02:00
Pere Diaz Bou
93e3b49f08 bench 2024-12-25 00:25:23 +01:00
Pekka Enberg
e93ac38e55 Add statement interruption support
This adds an interrupt() method to Statement that allows apps to
interrupt a running statement. Please note that this is different from
`sqlite3_interrupt()` which interrupts all ongoing operations in a
database. Although we want to support that too, per statement interrupt
is much more useful to apps.
2024-12-19 12:30:32 +02:00
jussisaurio
b6e88ca883 cargo clippy --fix --allow-dirty && cargo fmt 2024-09-15 09:35:39 +03:00
Pekka Enberg
31308f3699 core: Switch SQLite to use locking_mode EXCLUSIVE
Let's switch the SQLite benchmarks to use similar file locking protocol
as we do. Improves SQLite's performance by 2x, but Limbo is still
faster.

Before:

rusqlite/Prepare statement: 'SELECT * FROM users LIMIT 1'
                        time:   [2.1027 µs 2.1239 µs 2.1563 µs]
                        thrpt:  [463.75 Kelem/s 470.83 Kelem/s 475.57 Kelem/s]

After:

rusqlite/Execute prepared statement: 'SELECT * FROM users LIMIT 1'
                        time:   [940.07 ns 944.16 ns 949.39 ns]
                        thrpt:  [1.0533 Melem/s 1.0591 Melem/s 1.0638 Melem/s]
2024-08-03 21:13:50 +03:00
Brayan Jules
78568a53e3 fix format issues 2024-07-24 21:09:36 -04:00
Brayan Jules
529770bf32 bench: fix db lock on benchmark code by splitting the scopes between limbo and rusqlite. 2024-07-24 20:48:17 -04:00
Joan Martinez
dd34a4c045 bench: fix compilation 2024-07-22 11:42:25 +02:00
jussisaurio
40aa081ec2 Conditionally disable rusqlite benchmark 2024-07-17 11:52:17 +03:00
Pekka Enberg
7fa8f5c62e Add benchmarks for prepare() 2024-07-16 08:44:49 +03:00
Raminder Singh
e4a9c5ce6e fix clippy warnings 2024-07-14 16:50:54 +05:30
Pekka Enberg
1d4850df37 Fix invalid database path 2024-06-29 17:36:36 +03:00
Pekka Enberg
cc101b1b00 Use larger and more realistic database for testing 2024-06-29 10:03:11 +03:00
Pere Diaz Bou
377073e158 core: I/O write path 2024-06-19 21:26:40 +03:00
Pekka Enberg
ba1ed2ec09 Run I/O loop in benchmarks
Fixes #50
2024-06-08 08:43:15 +03:00
Pekka Enberg
7232683dfe core: Fix benchmark 2024-05-08 11:13:29 -03:00
Pekka Enberg
9098744a37 Rename to Limbo 2023-09-30 15:40:35 +03:00
Pekka Enberg
29a6c6b877 Fix benchmark compilation 2023-09-09 10:24:08 +03:00