This adds a `turso_assert` macro that is Antithesis aware when
`antithesis` feature flag is enabled. I did not yet convert any call-
sites to use it.
Closes#1880
This adds a `turso_assert` macro that is Antithesis aware when
`antithesis` feature flag is enabled. I did not yet convert any
call-sites to use it.
Co-authored-by: Nikita Sivukhin <sivukhin@turso.tech>
Stress runs have bunch of errors like this caused by reconnect in the
middle of a transaction:
```
Error executing query: Transaction error: cannot rollback - no transaction is active
```
This is fine, but let's add some logging that it's obvious why this
happens.
Closes#1878
Stress runs have bunch of errors like this caused by reconnect in the
middle of a transaction:
```
Error executing query: Transaction error: cannot rollback - no transaction is active
```
This is fine, but let's add some logging that it's obvious why this
happens.
I am not changing any package names - I'd rather Pekka do that so he can
verifies it works, or things that look like references to external
entities mentioning limbo.
All the rest is changed.
Closes#1868
I am not changing any package names - I'd rather Pekka do that so he
can verifies it works, or things that look like references to external
entities mentioning limbo.
All the rest is changed.
### Problem
Profiling revealed that `usable_space()` calls were consuming 60% of
total execution time for simple SELECT queries, making Limbo
approximately `6x` slower than SQLite for SELECT operations.
The bottleneck was caused by `usable_space()` performing expensive I/O
operations on every call to read `page_size` and `reserved_space` from
the database header, despite `page_size` values being effectively
immutable after database initialization. Only `reserved_space` is
allowed to increase in SQLite.
Evidence: https://share.firefox.dev/44tCUIy
### Solution
Implemented OnceCell-based caching for both page_size and reserved_space
values in the Pager struct:
`page_size: OnceCell<u16>` - Page size is immutable after database
initialization per SQLite specification
`reserved_space: OnceCell<u8>` - Reserved space rarely changes and only
grows, safe to cache
### Performance Impact
Benchmark results: Simple SELECT query time reduced from ~2.89ms to
~1.29ms (~55% improvement)
Closes#1852
Previously, the `jump_if_condition_is_true` flag was not respected. As a
result, for expressions like <`ISNULL`/`NOTNULL`> `OR` <rhs>, the <rhs>
expression was evaluated even when the left-hand side was true, and its
value was incorrectly used as the final result.
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>
Closes#1846