Skip to content

Commit

Permalink
Bindings: improve docs precision (#146)
Browse files Browse the repository at this point in the history
* bindings: improve docs precision

* Fix some 32 vs 64 bit comments

---------

Co-authored-by: George Kulakowski <george@clockworklabs.io>
  • Loading branch information
Centril and kulakowski authored Oct 3, 2023
1 parent 8f9ff27 commit 2daf06c
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 87 deletions.
175 changes: 142 additions & 33 deletions crates/bindings-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ pub mod raw {
///
/// The table id is written into the `out` pointer.
///
/// Returns an error if the table does not exist.
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - the slice `(name, name_len)` is not valid UTF-8
/// - `name + name_len` overflows a 64-bit address.
/// - writing to `out` overflows a 32-bit integer
pub fn _get_table_id(name: *const u8, name_len: usize, out: *mut u32) -> u16;

/// Creates an index with the name `index_name` and type `index_type`,
Expand All @@ -73,10 +77,14 @@ pub mod raw {
///
/// Currently only single-column-indices are supported
/// and they may only be of the btree index type.
/// In the former case, the function will panic,
/// and in latter, an error is returned.
///
/// Returns an error when a table with the provided `table_id` doesn't exist.
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - the slice `(index_name, index_name_len)` is not valid UTF-8
/// - `index_name + index_name_len` or `col_ids + col_len` overflow a 64-bit integer
/// - `index_type > 1`
///
/// Traps if `index_type == 1` or `col_ids.len() != 1`.
pub fn _create_index(
index_name: *const u8,
index_name_len: usize,
Expand All @@ -90,30 +98,55 @@ pub mod raw {
/// where the row has a column, identified by `col_id`,
/// with data matching the byte string, in WASM memory, pointed to at by `val`.
///
/// Matching is defined by decoding of `value` to an `AlgebraicValue`
/// Matching is defined BSATN-decoding `val` to an `AlgebraicValue`
/// according to the column's schema and then `Ord for AlgebraicValue`.
///
/// The rows found are bsatn encoded and then concatenated.
/// The rows found are BSATN encoded and then concatenated.
/// The resulting byte string from the concatenation is written
/// to a fresh buffer with the buffer's identifier written to the WASM pointer `out`.
pub fn _iter_by_col_eq(table_id: u32, col_id: u32, value: *const u8, value_len: usize, out: *mut Buffer)
-> u16;

/// Insert a row into the table identified by `table_id`,
/// where the row is read from the byte slice `row_ptr` in WASM memory,
///
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - `col_id` does not identify a column of the table,
/// - `(val, val_len)` cannot be decoded to an `AlgebraicValue`
/// typed at the `AlgebraicType` of the column,
/// - `val + val_len` overflows a 64-bit integer
pub fn _iter_by_col_eq(table_id: u32, col_id: u32, val: *const u8, val_len: usize, out: *mut Buffer) -> u16;

/// Inserts a row into the table identified by `table_id`,
/// where the row is read from the byte slice `row` in WASM memory,
/// lasting `row_len` bytes.
///
/// The `(row, row_len)` slice must be a BSATN-encoded `ProductValue`
/// matching the table's `ProductType` row-schema.
/// The `row` pointer is written to with the inserted row re-encoded.
/// This is due to auto-incrementing columns.
///
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - there were unique constraint violations
/// - `row + row_len` overflows a 64-bit integer
/// - `(row, row_len)` doesn't decode from BSATN to a `ProductValue`
/// according to the `ProductType` that the table's schema specifies.
pub fn _insert(table_id: u32, row: *mut u8, row_len: usize) -> u16;

/// Deletes all rows in the table identified by `table_id`
/// where the column identified by `col_id` matches the byte string,
/// in WASM memory, pointed to at by `value`.
///
/// Matching is defined by decoding of `value` to an `AlgebraicValue`
/// Matching is defined by BSATN-decoding `value` to an `AlgebraicValue`
/// according to the column's schema and then `Ord for AlgebraicValue`.
///
/// The number of rows deleted is written to the WASM pointer `out`.
///
/// Returns an error if no columns were deleted or if the column wasn't found.
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - no columns were deleted
/// - `col_id` does not identify a column of the table,
/// - `(value, value_len)` doesn't decode from BSATN to an `AlgebraicValue`
/// according to the `AlgebraicType` that the table's schema specifies for `col_id`.
/// - `value + value_len` overflows a 64-bit integer
/// - writing to `out` would overflow a 32-bit integer
pub fn _delete_by_col_eq(table_id: u32, col_id: u32, value: *const u8, value_len: usize, out: *mut u32) -> u16;

/*
Expand All @@ -135,6 +168,9 @@ pub mod raw {
///
/// The iterator is registered in the host environment
/// under an assigned index which is written to the `out` pointer provided.
///
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
pub fn _iter_start(table_id: u32, out: *mut BufferIter) -> u16;

/// Like [`_iter_start`], start iteration on each row,
Expand All @@ -145,6 +181,11 @@ pub mod raw {
///
/// The iterator is registered in the host environment
/// under an assigned index which is written to the `out` pointer provided.
///
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - `(filter, filter_len)` doesn't decode to a filter expression
/// - `filter + filter_len` overflows a 64-bit integer
pub fn _iter_start_filtered(table_id: u32, filter: *const u8, filter_len: usize, out: *mut BufferIter) -> u16;

/// Advances the registered iterator with the index given by `iter_key`.
Expand All @@ -153,6 +194,11 @@ pub mod raw {
/// The buffer's index is returned and written to the `out` pointer.
/// If there are no elements left, an invalid buffer index is written to `out`.
/// On failure however, the error is returned.
///
/// Returns an error if
/// - `iter` does not identify a registered `BufferIter`
/// - writing to `out` would overflow a 64-bit integer
/// - advancing the iterator resulted in an error
pub fn _iter_next(iter: ManuallyDrop<BufferIter>, out: *mut Buffer) -> u16;

/// Drops the entire registered iterator with the index given by `iter_key`.
Expand All @@ -161,11 +207,19 @@ pub mod raw {
/// Returns an error if the iterator does not exist.
pub fn _iter_drop(iter: ManuallyDrop<BufferIter>) -> u16;

/// Log at `level` a `text` message occuring in `filename:line_number`
/// Log at `level` a `message` message occuring in `filename:line_number`
/// with [`target`] being the module path at the `log!` invocation site.
///
/// These various pointers are interpreted lossily as UTF-8 strings with a corresponding `_len`.
///
/// The `target` and `filename` pointers are ignored by passing `NULL`.
/// The line number is ignored if `line_number == u32::MAX`.
///
/// No message is logged if
/// - `target != NULL && target + target_len > u64::MAX`
/// - `filename != NULL && filename + filename_len > u64::MAX`
/// - `message + message_len > u64::MAX`
///
/// [`target`]: https://docs.rs/log/latest/log/struct.Record.html#method.target
pub fn _console_log(
level: u8,
Expand All @@ -174,17 +228,22 @@ pub mod raw {
filename: *const u8,
filename_len: usize,
line_number: u32,
text: *const u8,
text_len: usize,
message: *const u8,
message_len: usize,
);

/// Schedule a reducer to be called asynchronously at `time`.
/// Schedules a reducer to be called asynchronously at `time`.
///
/// The reducer is named as the UTF-8 slice `(name, name_len)`,
/// The reducer is named as the valid UTF-8 slice `(name, name_len)`,
/// and is passed the slice `(args, args_len)` as its argument.
///
/// A generated schedule id is assigned to the reducer.
/// This id is written to the pointer `out`.
///
/// Traps if
/// - the `time` delay exceeds `64^6 - 1` milliseconds from now
/// - `name` does not point to valid UTF-8
/// - `name + name_len` or `args + args_len` overflow a 64-bit integer
pub fn _schedule_reducer(
name: *const u8,
name_len: usize,
Expand All @@ -199,18 +258,31 @@ pub mod raw {
/// This assumes that the reducer hasn't already been executed.
pub fn _cancel_reducer(id: u64);

/// Returns the length of buffer `bufh` without consuming the buffer handle.
/// Returns the length (number of bytes) of buffer `bufh` without
/// transferring ownership of the data into the function.
///
/// The `bufh` must have previously been allocating using `_buffer_alloc`.
///
/// Returns an error if the buffer does not exist.
/// Traps if the buffer does not exist.
pub fn _buffer_len(bufh: ManuallyDrop<Buffer>) -> usize;

/// Consumes the buffer `bufh`, moving its contents to the slice `(into, len)`.
/// Consumes the `buffer`,
/// moving its contents to the slice `(dst, dst_len)`.
///
/// Returns an error if the buffer does not exist.
pub fn _buffer_consume(bufh: Buffer, into: *mut u8, len: usize);
/// Traps if
/// - the buffer does not exist
/// - `dst + dst_len` overflows a 64-bit integer
pub fn _buffer_consume(buffer: Buffer, dst: *mut u8, dst_len: usize);

/// Creates a buffer of size `data_len` in the host environment.
/// The buffer is initialized with the contents at the `data` WASM pointer.
///
/// The contents of the byte slice pointed to by `data`
/// and lasting `data_len` bytes
/// is written into the newly initialized buffer.
///
/// The buffer is registered in the host environment and is indexed by the returned `u32`.
///
/// Traps if `data + data_len` overflows a 64-bit integer.
pub fn _buffer_alloc(data: *const u8, data_len: usize) -> Buffer;

/// Begin a timing span.
Expand Down Expand Up @@ -291,6 +363,7 @@ pub mod raw {
/// Represents table iterators, with a similar API to [`Buffer`].
#[repr(transparent)]
pub struct BufferIter {
/// The actual handle. A key into a `ResourceSlab`.
raw: u32,
}

Expand Down Expand Up @@ -457,10 +530,12 @@ pub fn get_table_id(name: &str) -> Result<u32, Errno> {
///
/// Currently only single-column-indices are supported
/// and they may only be of the btree index type.
/// In the former case, the function will panic,
/// and in latter, an error is returned.
///
/// Returns an error when a table with the provided `table_id` doesn't exist.
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - `index_type > 1`
///
/// Traps if `index_type == 1` or `col_ids.len() != 1`.
#[inline]
pub fn create_index(index_name: &str, table_id: u32, index_type: u8, col_ids: &[u8]) -> Result<(), Errno> {
cvt(unsafe {
Expand All @@ -477,27 +552,54 @@ pub fn create_index(index_name: &str, table_id: u32, index_type: u8, col_ids: &[

/// Finds all rows in the table identified by `table_id`,
/// where the row has a column, identified by `col_id`,
/// with data matching `val`.
/// with data matching the byte string `val`.
///
/// The rows found are bsatn encoded and then concatenated.
/// Matching is defined BSATN-decoding `val` to an `AlgebraicValue`
/// according to the column's schema and then `Ord for AlgebraicValue`.
///
/// The rows found are BSATN encoded and then concatenated.
/// The resulting byte string from the concatenation is written
/// to a fresh buffer with a handle to it returned as a `Buffer`.
///
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - `col_id` does not identify a column of the table
/// - `val` cannot be BSATN-decoded to an `AlgebraicValue`
/// typed at the `AlgebraicType` of the column
#[inline]
pub fn iter_by_col_eq(table_id: u32, col_id: u32, val: &[u8]) -> Result<Buffer, Errno> {
unsafe { call(|out| raw::_iter_by_col_eq(table_id, col_id, val.as_ptr(), val.len(), out)) }
}

/// Insert `row`, provided as a byte slice, into the table identified by `table_id`.
/// Inserts a row into the table identified by `table_id`,
/// where the row is a BSATN-encoded `ProductValue`
/// matching the table's `ProductType` row-schema.
///
/// The `row` is `&mut` due to auto-incrementing columns.
/// So `row` is written to with the inserted row re-encoded.
///
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - there were unique constraint violations
/// - `row` doesn't decode from BSATN to a `ProductValue`
/// according to the `ProductType` that the table's schema specifies.
#[inline]
pub fn insert(table_id: u32, row: &mut [u8]) -> Result<(), Errno> {
cvt(unsafe { raw::_insert(table_id, row.as_mut_ptr(), row.len()) })
}

/// Deletes all rows in the table identified by `table_id`
/// where the column identified by `col_id` equates to `value`.
/// where the column identified by `col_id` matches `value`.
///
/// Matching is defined by BSATN-decoding `value` to an `AlgebraicValue`
/// according to the column's schema and then `Ord for AlgebraicValue`.
///
/// Returns the number of rows deleted.
///
/// Returns the number of rows deleted
/// or an error if no columns were deleted or if the column wasn't found.
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - no columns were deleted
/// - `col_id` does not identify a column of the table
#[inline]
pub fn delete_by_col_eq(table_id: u32, col_id: u32, value: &[u8]) -> Result<u32, Errno> {
unsafe { call(|out| raw::_delete_by_col_eq(table_id, col_id, value.as_ptr(), value.len(), out)) }
Expand Down Expand Up @@ -536,6 +638,11 @@ pub fn delete_range(table_id: u32, col_id: u32, range_start: &[u8], range_end: &
///
/// The actual return value is a handle to an iterator registered with the host environment,
/// but [`BufferIter`] can be used directly as an `Iterator`.
///
/// Returns an error if
///
/// - a table with the provided `table_id` doesn't exist
/// - `Some(filter)` doesn't decode to a filter expression
#[inline]
pub fn iter(table_id: u32, filter: Option<&[u8]>) -> Result<BufferIter, Errno> {
unsafe {
Expand Down Expand Up @@ -600,6 +707,8 @@ pub fn console_log(
///
/// A generated schedule id is assigned to the reducer which is returned.
///
/// Returns an error if the `time` delay exceeds `64^6 - 1` milliseconds from now.
///
/// TODO: not fully implemented yet
/// TODO(Centril): Unsure what is unimplemented; perhaps it refers to a new
/// implementation with a special system table rather than a special sys call.
Expand Down
26 changes: 18 additions & 8 deletions crates/bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,18 @@ pub fn insert<T: TableType>(table_id: u32, row: T) -> T::InsertResult {
/// Matching is defined by decoding of `value` to an `AlgebraicValue`
/// according to the column's schema and then `Ord for AlgebraicValue`.
///
/// The rows found are bsatn encoded and then concatenated.
/// The rows found are BSATN encoded and then concatenated.
/// The resulting byte string from the concatenation is written
/// to a fresh buffer with a handle to it returned as a `Buffer`.
///
/// Panics when serialization fails.
/// Panics if
/// - BSATN serialization fails
/// - there were unique constraint violations
/// - `row` doesn't decode from BSATN to a `ProductValue`
/// according to the `ProductType` that the table's schema specifies
pub fn iter_by_col_eq(table_id: u32, col_id: u8, val: &impl Serialize) -> Result<Buffer> {
with_row_buf(|bytes| {
// Encode `val` as bsatn into `bytes` and then use that.
// Encode `val` as BSATN into `bytes` and then use that.
bsatn::to_writer(bytes, val).unwrap();
sys::iter_by_col_eq(table_id, col_id as u32, bytes)
})
Expand All @@ -192,14 +196,20 @@ pub fn iter_by_col_eq(table_id: u32, col_id: u8, val: &impl Serialize) -> Result
/// Matching is defined by decoding of `value` to an `AlgebraicValue`
/// according to the column's schema and then `Ord for AlgebraicValue`.
///
/// Returns the number of rows deleted
/// or an error if no columns were deleted or if the column wasn't found.
/// Returns the number of rows deleted.
///
/// Returns an error if
/// - a table with the provided `table_id` doesn't exist
/// - no columns were deleted
/// - `col_id` does not identify a column of the table,
/// - `value` doesn't decode from BSATN to an `AlgebraicValue`
/// according to the `AlgebraicType` that the table's schema specifies for `col_id`.
///
/// Panics when serialization fails.
pub fn delete_by_col_eq(table_id: u32, col_id: u8, eq_value: &impl Serialize) -> Result<u32> {
pub fn delete_by_col_eq(table_id: u32, col_id: u8, value: &impl Serialize) -> Result<u32> {
with_row_buf(|bytes| {
// Encode `val` as bsatn into `bytes` and then use that.
bsatn::to_writer(bytes, eq_value).unwrap();
// Encode `value` as BSATN into `bytes` and then use that.
bsatn::to_writer(bytes, value).unwrap();
sys::delete_by_col_eq(table_id, col_id.into(), bytes)
})
}
Expand Down
12 changes: 7 additions & 5 deletions crates/core/src/host/instance_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,17 @@ impl InstanceEnv {
Ok(table_id)
}

/// Creates an index of type `index_type`,
/// Creates an index of type `index_type` and name `index_name`,
/// on a product of the given columns in `col_ids`,
/// in the table identified by `table_id`.
///
/// Currently only btree index type are supported.
/// Currently only single-column-indices are supported.
/// That is, `col_ids.len() == 1`, or the call will panic.
///
/// The `table_name` is used together with the column ids to construct the name of the index.
/// As only single-column-indices are supported right now,
/// the name will be in the format `{table_name}_{cols}`.
/// Another limitation is on the `index_type`.
/// Only `btree` indices are supported as of now, i.e., `index_type == 0`.
/// When `index_type == 1` is passed, the call will happen
/// and on `index_type > 1`, an error is returned.
#[tracing::instrument(skip_all)]
pub fn create_index(
&self,
Expand Down
Loading

1 comment on commit 2daf06c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark for 2daf06c

Click to view benchmark
Test Base PR %
serialize/location/bsatn/count=100 2.2±0.03µs 44.3 MElem/sec N/A N/A
serialize/location/json/count=100 3.1±0.05µs 31.1 MElem/sec N/A N/A
serialize/location/product_value/count=100 2.0±0.03µs 47.4 MElem/sec N/A N/A
serialize/person/bsatn/count=100 2.8±0.03µs 34.5 MElem/sec N/A N/A
serialize/person/json/count=100 4.1±0.05µs 23.3 MElem/sec N/A N/A
serialize/person/product_value/count=100 1286.9±9.91ns 74.1 MElem/sec N/A N/A
sqlite/disk/empty 413.2±34.42ns 404.7±4.47ns -2.06%
sqlite/disk/filter/string/indexed/load=1000/count=10 5.6±0.07µs 173.7 KElem/sec N/A N/A
sqlite/disk/filter/string/non_indexed/load=1000/count=10 51.4±0.56µs 19.0 KElem/sec N/A N/A
sqlite/disk/filter/u64/indexed/load=1000/count=10 5.5±0.06µs 176.9 KElem/sec N/A N/A
sqlite/disk/filter/u64/non_indexed/load=1000/count=10 42.4±0.34µs 23.0 KElem/sec N/A N/A
sqlite/disk/find_unique/u32/load=1000 2.6±0.03µs 372.5 KElem/sec N/A N/A
sqlite/disk/insert_1/location/multi_index/load=0 19.1±0.21µs 51.0 KElem/sec N/A N/A
sqlite/disk/insert_1/location/multi_index/load=1000 21.1±0.41µs 46.4 KElem/sec N/A N/A
sqlite/disk/insert_1/location/non_unique/load=0 9.1±0.22µs 107.2 KElem/sec N/A N/A
sqlite/disk/insert_1/location/non_unique/load=1000 9.1±0.13µs 107.4 KElem/sec N/A N/A
sqlite/disk/insert_1/location/unique/load=0 9.1±0.16µs 107.4 KElem/sec N/A N/A
sqlite/disk/insert_1/location/unique/load=1000 9.2±0.15µs 106.3 KElem/sec N/A N/A
sqlite/disk/insert_1/person/multi_index/load=0 19.2±0.15µs 50.8 KElem/sec N/A N/A
sqlite/disk/insert_1/person/multi_index/load=1000 21.4±0.34µs 45.6 KElem/sec N/A N/A
sqlite/disk/insert_1/person/non_unique/load=0 9.2±0.11µs 105.7 KElem/sec N/A N/A
sqlite/disk/insert_1/person/non_unique/load=1000 9.2±0.13µs 106.1 KElem/sec N/A N/A
sqlite/disk/insert_1/person/unique/load=0 9.3±0.12µs 105.4 KElem/sec N/A N/A
sqlite/disk/insert_1/person/unique/load=1000 9.3±0.15µs 105.4 KElem/sec N/A N/A
sqlite/disk/insert_bulk/location/multi_index/load=0/count=100 119.2±1.76µs 125.2±1.32µs +5.03%
sqlite/disk/insert_bulk/location/multi_index/load=1000/count=100 209.3±3.66µs 214.4±3.10µs +2.44%
sqlite/disk/insert_bulk/location/non_unique/load=0/count=100 40.2±0.47µs 24.3 KElem/sec N/A N/A
sqlite/disk/insert_bulk/location/non_unique/load=1000/count=100 44.2±0.55µs 22.1 KElem/sec N/A N/A
sqlite/disk/insert_bulk/location/unique/load=0/count=100 43.0±0.24µs 22.7 KElem/sec N/A N/A
sqlite/disk/insert_bulk/location/unique/load=1000/count=100 49.0±0.52µs 19.9 KElem/sec N/A N/A
sqlite/disk/insert_bulk/person/multi_index/load=0/count=100 102.9±0.59µs 108.3±1.25µs +5.25%
sqlite/disk/insert_bulk/person/multi_index/load=1000/count=100 243.6±6.19µs 239.9±3.65µs -1.52%
sqlite/disk/insert_bulk/person/non_unique/load=0/count=100 48.4±1.94µs 20.2 KElem/sec N/A N/A
sqlite/disk/insert_bulk/person/non_unique/load=1000/count=100 57.1±0.67µs 17.1 KElem/sec N/A N/A
sqlite/disk/insert_bulk/person/unique/load=0/count=100 47.3±4.29µs 20.6 KElem/sec N/A N/A
sqlite/disk/insert_bulk/person/unique/load=1000/count=100 49.3±0.89µs 19.8 KElem/sec N/A N/A
sqlite/disk/iterate/location/unique/count=100 8.4±0.09µs 116.6 KElem/sec N/A N/A
sqlite/disk/iterate/person/unique/count=100 8.7±0.08µs 112.1 KElem/sec N/A N/A
sqlite/mem/empty 404.7±2.72ns 404.0±4.50ns -0.17%
sqlite/mem/filter/string/indexed/load=1000/count=10 3.8±0.06µs 256.6 KElem/sec N/A N/A
sqlite/mem/filter/string/non_indexed/load=1000/count=10 51.8±0.06µs 18.9 KElem/sec N/A N/A
sqlite/mem/filter/u64/indexed/load=1000/count=10 3.7±0.03µs 262.5 KElem/sec N/A N/A
sqlite/mem/filter/u64/non_indexed/load=1000/count=10 37.2±0.23µs 26.2 KElem/sec N/A N/A
sqlite/mem/find_unique/u32/load=1000 1043.7±19.55ns 935.6 KElem/sec N/A N/A
sqlite/mem/insert_1/location/multi_index/load=0 4.0±0.03µs 245.9 KElem/sec N/A N/A
sqlite/mem/insert_1/location/multi_index/load=1000 4.8±0.14µs 201.4 KElem/sec N/A N/A
sqlite/mem/insert_1/location/non_unique/load=0 1660.1±27.22ns 588.3 KElem/sec N/A N/A
sqlite/mem/insert_1/location/non_unique/load=1000 1763.8±38.22ns 553.7 KElem/sec N/A N/A
sqlite/mem/insert_1/location/unique/load=0 1637.9±16.80ns 596.2 KElem/sec N/A N/A
sqlite/mem/insert_1/location/unique/load=1000 1823.6±42.04ns 535.5 KElem/sec N/A N/A
sqlite/mem/insert_1/person/multi_index/load=0 3.8±0.15µs 254.9 KElem/sec N/A N/A
sqlite/mem/insert_1/person/multi_index/load=1000 5.3±0.10µs 185.9 KElem/sec N/A N/A
sqlite/mem/insert_1/person/non_unique/load=0 1699.7±37.16ns 574.5 KElem/sec N/A N/A
sqlite/mem/insert_1/person/non_unique/load=1000 1871.4±17.46ns 521.8 KElem/sec N/A N/A
sqlite/mem/insert_1/person/unique/load=0 1672.3±11.34ns 583.9 KElem/sec N/A N/A
sqlite/mem/insert_1/person/unique/load=1000 1893.3±24.51ns 515.8 KElem/sec N/A N/A
sqlite/mem/insert_bulk/location/multi_index/load=0/count=100 102.1±0.91µs 108.4±0.79µs +6.17%
sqlite/mem/insert_bulk/location/multi_index/load=1000/count=100 158.8±1.27µs 164.0±1.47µs +3.27%
sqlite/mem/insert_bulk/location/non_unique/load=0/count=100 32.5±1.70µs 30.0 KElem/sec N/A N/A
sqlite/mem/insert_bulk/location/non_unique/load=1000/count=100 35.4±0.36µs 27.6 KElem/sec N/A N/A
sqlite/mem/insert_bulk/location/unique/load=0/count=100 35.0±0.17µs 27.9 KElem/sec N/A N/A
sqlite/mem/insert_bulk/location/unique/load=1000/count=100 39.8±1.38µs 24.5 KElem/sec N/A N/A
sqlite/mem/insert_bulk/person/multi_index/load=0/count=100 87.0±0.71µs 11.2 KElem/sec N/A N/A
sqlite/mem/insert_bulk/person/multi_index/load=1000/count=100 175.6±1.27µs 179.7±1.51µs +2.33%
sqlite/mem/insert_bulk/person/non_unique/load=0/count=100 32.0±0.14µs 30.5 KElem/sec N/A N/A
sqlite/mem/insert_bulk/person/non_unique/load=1000/count=100 38.4±1.33µs 25.4 KElem/sec N/A N/A
sqlite/mem/insert_bulk/person/unique/load=0/count=100 35.3±0.18µs 27.6 KElem/sec N/A N/A
sqlite/mem/insert_bulk/person/unique/load=1000/count=100 40.5±0.26µs 24.1 KElem/sec N/A N/A
sqlite/mem/iterate/location/unique/count=100 7.0±0.06µs 139.7 KElem/sec N/A N/A
sqlite/mem/iterate/person/unique/count=100 7.0±0.13µs 139.6 KElem/sec N/A N/A
stdb_module/disk/empty 28.0±2.09µs 27.9±2.49µs -0.36%
stdb_module/disk/filter/string/indexed/load=1000/count=10 57.6±4.44µs 16.9 KElem/sec N/A N/A
stdb_module/disk/filter/string/non_indexed/load=1000/count=10 163.8±3.73µs 166.5±6.70µs +1.65%
stdb_module/disk/filter/u64/indexed/load=1000/count=10 49.4±3.35µs 19.8 KElem/sec N/A N/A
stdb_module/disk/filter/u64/non_indexed/load=1000/count=10 137.7±4.56µs 143.4±12.72µs +4.14%
stdb_module/disk/find_unique/u32/load=1000 35.7±2.08µs 27.4 KElem/sec N/A N/A
stdb_module/disk/insert_1/location/multi_index/load=0 48.4±4.31µs 20.2 KElem/sec N/A N/A
stdb_module/disk/insert_1/location/multi_index/load=1000 295.5±14.43µs 281.7±38.99µs -4.67%
stdb_module/disk/insert_1/location/non_unique/load=0 42.5±3.35µs 23.0 KElem/sec N/A N/A
stdb_module/disk/insert_1/location/non_unique/load=1000 275.4±16.26µs 250.1±24.13µs -9.19%
stdb_module/disk/insert_1/location/unique/load=0 43.8±1.94µs 22.3 KElem/sec N/A N/A
stdb_module/disk/insert_1/location/unique/load=1000 285.8±16.12µs 286.1±29.54µs +0.10%
stdb_module/disk/insert_1/person/multi_index/load=0 56.2±6.25µs 17.4 KElem/sec N/A N/A
stdb_module/disk/insert_1/person/multi_index/load=1000 540.7±102.02µs 486.4±46.00µs -10.04%
stdb_module/disk/insert_1/person/non_unique/load=0 47.0±4.13µs 20.8 KElem/sec N/A N/A
stdb_module/disk/insert_1/person/non_unique/load=1000 293.0±33.13µs 310.3±34.97µs +5.90%
stdb_module/disk/insert_1/person/unique/load=0 50.6±5.58µs 19.3 KElem/sec N/A N/A
stdb_module/disk/insert_1/person/unique/load=1000 295.9±50.69µs 315.0±37.26µs +6.45%
stdb_module/disk/insert_bulk/location/multi_index/load=0/count=100 820.8±11.75µs 812.4±11.68µs -1.02%
stdb_module/disk/insert_bulk/location/multi_index/load=1000/count=100 1120.8±32.17µs 1117.6±49.89µs -0.29%
stdb_module/disk/insert_bulk/location/non_unique/load=0/count=100 583.5±18.06µs 583.7±6.56µs +0.03%
stdb_module/disk/insert_bulk/location/non_unique/load=1000/count=100 767.3±19.44µs 773.8±27.50µs +0.85%
stdb_module/disk/insert_bulk/location/unique/load=0/count=100 708.4±14.71µs 706.4±10.43µs -0.28%
stdb_module/disk/insert_bulk/location/unique/load=1000/count=100 953.0±45.82µs 944.4±42.44µs -0.90%
stdb_module/disk/insert_bulk/person/multi_index/load=0/count=100 1303.9±22.80µs 1311.9±15.14µs +0.61%
stdb_module/disk/insert_bulk/person/multi_index/load=1000/count=100 1775.1±82.78µs 1770.3±53.49µs -0.27%
stdb_module/disk/insert_bulk/person/non_unique/load=0/count=100 764.5±22.49µs 773.9±22.62µs +1.23%
stdb_module/disk/insert_bulk/person/non_unique/load=1000/count=100 1017.0±41.21µs 1015.5±22.47µs -0.15%
stdb_module/disk/insert_bulk/person/unique/load=0/count=100 989.0±20.78µs 987.9±17.52µs -0.11%
stdb_module/disk/insert_bulk/person/unique/load=1000/count=100 1255.6±73.42µs 1273.1±38.69µs +1.39%
stdb_module/disk/iterate/location/unique/count=100 163.7±7.10µs 162.6±4.70µs -0.67%
stdb_module/disk/iterate/person/unique/count=100 246.7±7.91µs 248.9±5.07µs +0.89%
stdb_module/large_arguments/64KiB 118.7±11.17µs 111.7±2.12µs -5.90%
stdb_module/mem/empty 29.8±1.64µs 29.9±1.73µs +0.34%
stdb_module/mem/filter/string/indexed/load=1000/count=10 58.1±4.98µs 16.8 KElem/sec N/A N/A
stdb_module/mem/filter/string/non_indexed/load=1000/count=10 157.9±1.88µs 163.1±3.20µs +3.29%
stdb_module/mem/filter/u64/indexed/load=1000/count=10 52.3±5.20µs 18.7 KElem/sec N/A N/A
stdb_module/mem/filter/u64/non_indexed/load=1000/count=10 137.4±11.38µs 135.3±5.24µs -1.53%
stdb_module/mem/find_unique/u32/load=1000 35.4±1.42µs 27.6 KElem/sec N/A N/A
stdb_module/mem/insert_1/location/multi_index/load=0 42.9±1.72µs 22.8 KElem/sec N/A N/A
stdb_module/mem/insert_1/location/multi_index/load=1000 264.7±24.21µs 255.7±28.73µs -3.40%
stdb_module/mem/insert_1/location/non_unique/load=0 40.0±2.34µs 24.4 KElem/sec N/A N/A
stdb_module/mem/insert_1/location/non_unique/load=1000 211.6±13.64µs 208.1±6.26µs -1.65%
stdb_module/mem/insert_1/location/unique/load=0 41.8±2.33µs 23.4 KElem/sec N/A N/A
stdb_module/mem/insert_1/location/unique/load=1000 224.6±20.72µs 218.5±15.98µs -2.72%
stdb_module/mem/insert_1/person/multi_index/load=0 48.7±3.55µs 20.0 KElem/sec N/A N/A
stdb_module/mem/insert_1/person/multi_index/load=1000 527.4±56.57µs 480.1±64.81µs -8.97%
stdb_module/mem/insert_1/person/non_unique/load=0 42.5±3.79µs 23.0 KElem/sec N/A N/A
stdb_module/mem/insert_1/person/non_unique/load=1000 221.5±12.76µs 231.7±22.73µs +4.60%
stdb_module/mem/insert_1/person/unique/load=0 46.4±3.27µs 21.0 KElem/sec N/A N/A
stdb_module/mem/insert_1/person/unique/load=1000 265.0±32.86µs 267.7±38.37µs +1.02%
stdb_module/mem/insert_bulk/location/multi_index/load=0/count=100 737.6±8.98µs 731.5±13.55µs -0.83%
stdb_module/mem/insert_bulk/location/multi_index/load=1000/count=100 956.5±31.25µs 955.4±26.71µs -0.12%
stdb_module/mem/insert_bulk/location/non_unique/load=0/count=100 513.8±11.81µs 499.5±4.19µs -2.78%
stdb_module/mem/insert_bulk/location/non_unique/load=1000/count=100 662.2±13.06µs 649.5±13.60µs -1.92%
stdb_module/mem/insert_bulk/location/unique/load=0/count=100 623.3±8.21µs 624.2±12.52µs +0.14%
stdb_module/mem/insert_bulk/location/unique/load=1000/count=100 831.8±25.77µs 824.3±15.21µs -0.90%
stdb_module/mem/insert_bulk/person/multi_index/load=0/count=100 1267.5±30.91µs 1253.1±20.74µs -1.14%
stdb_module/mem/insert_bulk/person/multi_index/load=1000/count=100 1677.4±52.10µs 1632.0±61.72µs -2.71%
stdb_module/mem/insert_bulk/person/non_unique/load=0/count=100 709.8±10.90µs 701.4±34.69µs -1.18%
stdb_module/mem/insert_bulk/person/non_unique/load=1000/count=100 918.2±11.83µs 912.5±23.58µs -0.62%
stdb_module/mem/insert_bulk/person/unique/load=0/count=100 921.7±10.68µs 932.5±14.64µs +1.17%
stdb_module/mem/insert_bulk/person/unique/load=1000/count=100 1146.4±50.02µs 1177.3±46.10µs +2.70%
stdb_module/mem/iterate/location/unique/count=100 163.7±3.79µs 158.4±4.16µs -3.24%
stdb_module/mem/iterate/person/unique/count=100 249.1±9.52µs 249.8±3.89µs +0.28%
stdb_module/print_bulk/lines=1 33.9±1.32µs 35.4±1.78µs +4.42%
stdb_module/print_bulk/lines=100 366.6±7.31µs 382.4±14.11µs +4.31%
stdb_module/print_bulk/lines=1000 3.3±0.04ms 3.5±0.15ms +6.06%
stdb_raw/disk/empty 99.0±1.15ns 99.3±1.35ns +0.30%
stdb_raw/disk/filter/string/indexed/load=1000/count=10 2.4±0.03µs 406.3 KElem/sec N/A N/A
stdb_raw/disk/filter/string/non_indexed/load=1000/count=10 116.6±1.13µs 110.8±1.12µs -4.97%
stdb_raw/disk/filter/u64/indexed/load=1000/count=10 2.3±0.02µs 432.1 KElem/sec N/A N/A
stdb_raw/disk/filter/u64/non_indexed/load=1000/count=10 94.3±2.48µs 10.4 KElem/sec N/A N/A
stdb_raw/disk/find_unique/u32/load=1000 549.3±15.98ns 1777.8 KElem/sec N/A N/A
stdb_raw/disk/insert_1/location/multi_index/load=0 6.5±0.13µs 151.2 KElem/sec N/A N/A
stdb_raw/disk/insert_1/location/multi_index/load=1000 31.6±4.13µs 30.9 KElem/sec N/A N/A
stdb_raw/disk/insert_1/location/non_unique/load=0 4.3±0.05µs 225.3 KElem/sec N/A N/A
stdb_raw/disk/insert_1/location/non_unique/load=1000 20.5±10.77µs 47.7 KElem/sec N/A N/A
stdb_raw/disk/insert_1/location/unique/load=0 5.3±0.06µs 184.2 KElem/sec N/A N/A
stdb_raw/disk/insert_1/location/unique/load=1000 25.0±0.47µs 39.0 KElem/sec N/A N/A
stdb_raw/disk/insert_1/person/multi_index/load=0 10.2±0.11µs 95.6 KElem/sec N/A N/A
stdb_raw/disk/insert_1/person/multi_index/load=1000 30.3±1.44µs 32.2 KElem/sec N/A N/A
stdb_raw/disk/insert_1/person/non_unique/load=0 5.0±0.05µs 193.9 KElem/sec N/A N/A
stdb_raw/disk/insert_1/person/non_unique/load=1000 15.9±0.35µs 61.3 KElem/sec N/A N/A
stdb_raw/disk/insert_1/person/unique/load=0 7.1±0.09µs 137.1 KElem/sec N/A N/A
stdb_raw/disk/insert_1/person/unique/load=1000 24.5±0.85µs 39.9 KElem/sec N/A N/A
stdb_raw/disk/insert_bulk/location/multi_index/load=0/count=100 334.2±3.25µs 335.2±4.39µs +0.30%
stdb_raw/disk/insert_bulk/location/multi_index/load=1000/count=100 399.3±5.13µs 399.2±10.21µs -0.03%
stdb_raw/disk/insert_bulk/location/non_unique/load=0/count=100 155.8±1.30µs 153.6±6.16µs -1.41%
stdb_raw/disk/insert_bulk/location/non_unique/load=1000/count=100 180.8±1.67µs 178.6±3.30µs -1.22%
stdb_raw/disk/insert_bulk/location/unique/load=0/count=100 246.5±2.75µs 246.9±2.07µs +0.16%
stdb_raw/disk/insert_bulk/location/unique/load=1000/count=100 302.1±7.86µs 299.2±4.20µs -0.96%
stdb_raw/disk/insert_bulk/person/multi_index/load=0/count=100 694.3±9.38µs 705.5±12.54µs +1.61%
stdb_raw/disk/insert_bulk/person/multi_index/load=1000/count=100 777.0±10.48µs 785.9±12.11µs +1.15%
stdb_raw/disk/insert_bulk/person/non_unique/load=0/count=100 212.3±2.64µs 214.0±1.75µs +0.80%
stdb_raw/disk/insert_bulk/person/non_unique/load=1000/count=100 243.6±2.87µs 243.0±1.64µs -0.25%
stdb_raw/disk/insert_bulk/person/unique/load=0/count=100 401.9±3.39µs 402.7±4.02µs +0.20%
stdb_raw/disk/insert_bulk/person/unique/load=1000/count=100 461.1±4.79µs 466.3±7.95µs +1.13%
stdb_raw/disk/iterate/location/unique/count=100 8.9±0.08µs 109.1 KElem/sec N/A N/A
stdb_raw/disk/iterate/person/unique/count=100 9.7±0.09µs 100.6 KElem/sec N/A N/A
stdb_raw/mem/empty 101.5±1.11ns 101.6±0.50ns +0.10%
stdb_raw/mem/filter/string/indexed/load=1000/count=10 2.4±0.02µs 403.5 KElem/sec N/A N/A
stdb_raw/mem/filter/string/non_indexed/load=1000/count=10 117.1±0.96µs 109.9±1.31µs -6.15%
stdb_raw/mem/filter/u64/indexed/load=1000/count=10 2.2±0.01µs 436.0 KElem/sec N/A N/A
stdb_raw/mem/filter/u64/non_indexed/load=1000/count=10 93.7±1.73µs 10.4 KElem/sec N/A N/A
stdb_raw/mem/find_unique/u32/load=1000 551.3±10.94ns 1771.4 KElem/sec N/A N/A
stdb_raw/mem/insert_1/location/multi_index/load=0 4.7±0.04µs 207.6 KElem/sec N/A N/A
stdb_raw/mem/insert_1/location/multi_index/load=1000 25.8±0.67µs 37.9 KElem/sec N/A N/A
stdb_raw/mem/insert_1/location/non_unique/load=0 2.7±0.04µs 365.2 KElem/sec N/A N/A
stdb_raw/mem/insert_1/location/non_unique/load=1000 15.6±0.34µs 62.6 KElem/sec N/A N/A
stdb_raw/mem/insert_1/location/unique/load=0 3.4±0.04µs 285.7 KElem/sec N/A N/A
stdb_raw/mem/insert_1/location/unique/load=1000 21.1±0.26µs 46.4 KElem/sec N/A N/A
stdb_raw/mem/insert_1/person/multi_index/load=0 8.3±0.10µs 117.8 KElem/sec N/A N/A
stdb_raw/mem/insert_1/person/multi_index/load=1000 25.8±1.38µs 37.8 KElem/sec N/A N/A
stdb_raw/mem/insert_1/person/non_unique/load=0 3.2±0.27µs 303.9 KElem/sec N/A N/A
stdb_raw/mem/insert_1/person/non_unique/load=1000 10.9±0.33µs 89.4 KElem/sec N/A N/A
stdb_raw/mem/insert_1/person/unique/load=0 5.2±0.04µs 189.0 KElem/sec N/A N/A
stdb_raw/mem/insert_1/person/unique/load=1000 17.6±0.67µs 55.6 KElem/sec N/A N/A
stdb_raw/mem/insert_bulk/location/multi_index/load=0/count=100 339.8±4.24µs 332.4±3.85µs -2.18%
stdb_raw/mem/insert_bulk/location/multi_index/load=1000/count=100 393.6±4.31µs 388.6±6.15µs -1.27%
stdb_raw/mem/insert_bulk/location/non_unique/load=0/count=100 154.7±1.39µs 148.2±1.86µs -4.20%
stdb_raw/mem/insert_bulk/location/non_unique/load=1000/count=100 176.1±1.33µs 172.0±2.61µs -2.33%
stdb_raw/mem/insert_bulk/location/unique/load=0/count=100 248.0±1.65µs 247.7±8.04µs -0.12%
stdb_raw/mem/insert_bulk/location/unique/load=1000/count=100 295.4±5.60µs 294.3±2.40µs -0.37%
stdb_raw/mem/insert_bulk/person/multi_index/load=0/count=100 700.0±7.41µs 701.5±4.76µs +0.21%
stdb_raw/mem/insert_bulk/person/multi_index/load=1000/count=100 769.3±9.31µs 773.4±30.09µs +0.53%
stdb_raw/mem/insert_bulk/person/non_unique/load=0/count=100 212.9±2.80µs 210.4±2.32µs -1.17%
stdb_raw/mem/insert_bulk/person/non_unique/load=1000/count=100 240.8±1.60µs 236.9±2.46µs -1.62%
stdb_raw/mem/insert_bulk/person/unique/load=0/count=100 405.4±3.55µs 404.2±7.92µs -0.30%
stdb_raw/mem/insert_bulk/person/unique/load=1000/count=100 454.6±3.45µs 449.7±5.50µs -1.08%
stdb_raw/mem/iterate/location/unique/count=100 8.9±0.09µs 110.1 KElem/sec N/A N/A
stdb_raw/mem/iterate/person/unique/count=100 10.0±0.21µs 97.3 KElem/sec N/A N/A

Please sign in to comment.