Commit Graph

3 Commits

Author SHA1 Message Date
james gilles 5ad9baa304 Pre-decompress query updates (#302)
This dramatically improves performance by avoiding the default
implementation of BrotliStream.ReadByte() inherited from Stream, which
allocates an array per byte read.

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs

## Testsuite

SpacetimeDB branch name: master

## Testing
*Write instructions for a test that you performed for this PR*

- [ ] Describe a test for this PR that you have completed
2025-04-23 20:44:16 -07:00
james gilles f32754b3c7 Fix row deduplication issues (#294)
## Description of Changes
Addresses
https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1585

There was an issue with row deduplication when a TransactionUpdate of
the form:

```
+ k1: v1
- k1: v1
- k1: v1
+ k1: v2
```
appeared, where `k1` is the primary key of a row and `v1`, `v2` are the
full values of that row. The old manner of processing updates would see
this as a no-op. I've updated the logic to handle this case correctly,
at the cost of an extra equality comparison per row in an update.
(Actually it's slightly cheaper than this, it skips the equality
comparison if there is only row with a particular primary key in an
update. This may help speed up processing of large updates e.g. chunk
data in BitCraft.)

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs

## Testsuite

SpacetimeDB branch name: master

## Testing

- [x] Added a failing test, then fixed it
2025-04-18 08:59:08 -07:00
james gilles 083531e319 SubscribeMulti + UnsubscribeMulti, multiplicities (#249)
## Description of Changes
Add SubscribeMulti and UnsubscribeMulti from upstream.
Fix unsubscribe bug found by testing against Bitcraft: Calling
`UnsubscribeThen` with any (non-null) callback would result in an
exception incorrectly telling the user that `Unsubscribe` had been
called twice.
Multiplicity support is implemented with unit tests + manual testing of
quickstart-chat.
Also, rows in the client cache are now looked up by primary key if
available, which I suspect is going to be a large performance boost.

## API

 - [x] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*

SpacetimeDB branch name: jgilles/final-cs-codegen-changes

## Testing
*Write instructions for a test that you performed for this PR*

- [x] unit tests
- [ ] Working with Ryan to add a test suite.
- [x] blackholio
2025-02-25 16:24:26 -05:00