-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recv-style abi #1002
recv-style abi #1002
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write a document describing the design of the new ABI.
crates/core/src/host/instance_env.rs
Outdated
// For now, just send buffers over a certain fixed size. | ||
// This is kept in sync with `DEFAULT_BUFFER_CAPACITY` in `crates/bindings/src/lib.rs` | ||
const ITER_CHUNK_SIZE: usize = 0x20_000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could sneak this into spacetimedb-primitives
as it is shared between bindings and db.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, true. errnos should probably go there as well.
9294c74
to
5086358
Compare
5086358
to
5ec11db
Compare
crates/core/src/host/instance_env.rs
Outdated
trait ToBsatn { | ||
fn to_bstan_extend(&self, buf: &mut Vec<u8>) -> Result<(), BsatnError>; | ||
} | ||
impl ToBsatn for RowRef<'_> { | ||
fn to_bstan_extend(&self, buf: &mut Vec<u8>) -> Result<(), BsatnError> { | ||
self.to_bsatn_extend(buf) | ||
} | ||
} | ||
impl ToBsatn for RelValue<'_> { | ||
fn to_bstan_extend(&self, buf: &mut Vec<u8>) -> Result<(), BsatnError> { | ||
self.to_bsatn_extend(buf) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd call this trait ToBsatnExtend
and the types could implement them directly and the inherent methods could be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I might do that as a follow-up - ideally it'd probably go in the sats crate or something but I'd like to try making it more generalized if we do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unnecessary ABI changes such as removing the underscore (see inline comments).
benchmarks please |
Criterion benchmark resultsCriterion benchmark reportYOU SHOULD PROBABLY IGNORE THESE RESULTS. Criterion is a wall time based benchmarking system that is extremely noisy when run on CI. We collect these results for longitudinal analysis, but they are not reliable for comparing individual PRs. Go look at the callgrind report instead. empty
insert_1
insert_bulk
iterate
find_unique
filter
serialize
stdb_module_large_arguments
stdb_module_print_bulk
remaining
|
58e9f3f
to
428fb89
Compare
428fb89
to
62d51b9
Compare
Description of Changes
Still need to update the csharp wasm bindings. Also, unsure about that
exhausted
out param. Might be superfluous.Expected complexity level and risk
3
Testing
smoketests pass - I think those cover all the API usage so I'm confident it doesn't crash or anything. bot-testing might be good to gauge perf improvement/impact.