-
Notifications
You must be signed in to change notification settings - Fork 69
chore(zero): remove ast
from downstream query patch messages [cust-queries]
#4392
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
base: main
Are you sure you want to change the base?
Conversation
tantaman
commented
May 16, 2025
- It is extra information that does not need to be sent
- Custom queries will not send their AST to the client
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Branch | mlaw/no-ast-patch |
Testbed | Linux |
Click to view all benchmark results
Benchmark | File Size | Benchmark Result kilobytes (KB) (Result Δ%) | Upper Boundary kilobytes (KB) (Limit %) |
---|---|---|---|
zero-package.tgz | 📈 view plot 🚷 view threshold | 1,165.06 KB(-0.02%)Baseline: 1,165.28 KB | 1,188.59 KB (98.02%) |
zero.js | 📈 view plot 🚷 view threshold | 193.86 KB(+0.01%)Baseline: 193.84 KB | 197.72 KB (98.05%) |
zero.js.br | 📈 view plot 🚷 view threshold | 54.45 KB(+0.06%)Baseline: 54.42 KB | 55.51 KB (98.10%) |
|
Branch | mlaw/no-ast-patch |
Testbed | Linux |
Click to view all benchmark results
Benchmark | Throughput | Benchmark Result operations / second (ops/s) (Result Δ%) | Lower Boundary operations / second (ops/s) (Limit %) |
---|---|---|---|
src/client/custom.bench.ts > big schema | 📈 view plot 🚷 view threshold | 321,482.58 ops/s(+15.80%)Baseline: 277,611.56 ops/s | 104,489.26 ops/s (32.50%) |
src/client/zero.bench.ts > basics > All 1000 rows x 10 columns (numbers) | 📈 view plot 🚷 view threshold | 1,549.83 ops/s(+20.47%)Baseline: 1,286.53 ops/s | 513.54 ops/s (33.14%) |
src/client/zero.bench.ts > pk compare > pk = N | 📈 view plot 🚷 view threshold | 31,133.77 ops/s(+22.88%)Baseline: 25,336.37 ops/s | 11,796.50 ops/s (37.89%) |
src/client/zero.bench.ts > with filter > Lower rows 500 x 10 columns (numbers) | 📈 view plot 🚷 view threshold | 2,508.00 ops/s(+23.81%)Baseline: 2,025.71 ops/s | 793.89 ops/s (31.65%) |
e160127
to
fa70c57
Compare
fa70c57
to
6219c2e
Compare
88f5a0d
to
9c3cddf
Compare
9c3cddf
to
623fd14
Compare
623fd14
to
abb3a51
Compare
abb3a51
to
7181f3e
Compare
7181f3e
to
116788c
Compare
116788c
to
2758668
Compare
2758668
to
fe1efe8
Compare
fe1efe8
to
33b6dcc
Compare
1. It is extra information that does not need to be sent 2. Custom queries will not send their AST to the client
33b6dcc
to
49d4699
Compare
@@ -4,10 +4,13 @@ import {astSchema} from './ast.ts'; | |||
export const putOpSchema = v.object({ | |||
op: v.literal('put'), | |||
hash: v.string(), | |||
ast: astSchema, |
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.
This is a tricky one. We're bumping the PROTOCOL_VERSION (which is correct), but not the MIN_SERVER_SUPPORTED_PROTOCOL_VERSION, which means the server will still accept connections from old clients (that expect the ast
field), and for them the server will return a response that fails to parse on the client side. (I think ... we should be parsing with strict
rather than passthrough
for the wire protocol, to be extra safe)
Best thing to do would be to make ast
optional, with a comment that it's deprecated, and when we later bump the MIN_SERVER_SUPPORTED_PROTOCOL_VERSION
to 17, then we can delete the field.
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.
Also, to clarify, we should not bump the MIN_SERVER_SUPPORTED_PROTOCOL
in this change as that would result in a period of time in which the new server cannot talk to any old clients.
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.
Yay. Thank you for cleaning this up. This simplifies and clarifies the protocol a lot. 🙏