zix http1 entry - #998
Conversation
|
Testing new approach and database tests entries for H1. |
|
/benchmark -f zix |
|
👋 |
Benchmark ResultsFramework:
Full log |
|
Oh my, didn't expect the cpu burn that much with high memory consumption. |
… propagation - Migrate JSON parsing and serialization across `json`, `crud`, and `dataset` modules to use `jzon`, eliminating manual string building and `std.json` overhead. - Remove response memoization and startup pre-serialization. The `json` handler now serializes per request, and `crudcache` strictly operates as a row-level cache-aside (holding decoded DB rows, not rendered HTTP responses) to accurately reflect benchmark profile constraints. - Replace the custom `static` handler with the engine's native `public_dir` configuration. - Enforce strict error propagation by converting handlers and shared responders (`response.zig`) to return `!void`, replacing silent error swallowing with `try`. - Centralize byte-buffer formatting utilities (integers, strings, JSON escaping) into `shared/util.zig`. - Refactor `dbpg` to use a shared `CrudWrite` payload for create/update jobs and improve lane arming logic for `.URING` vs `.EPOLL`/`.ASYNC` models. - Add comprehensive module-level documentation explaining design choices, benchmark constraints, and engine interactions. - Update `Dockerfile` to target Zix `0.5.x` and change Zig build summary to `failures`. - Add `static-tls` to the `meta.json` test matrix.
|
Bump zix branch to 0.5.x and follow-up #1121 (comment) |
|
/benchmark -f zix |
|
👋 Benchmark request received. A collaborator will review and approve the run. |
Benchmark ResultsFramework:
Full log |
|
/benchmark -f zix --save |
|
👋 Benchmark request received. A collaborator will review and approve the run. |
Benchmark ResultsFramework:
Full log |
|
Hi, open to review for this pull-request. |
|
#997 and #982 already merged, but this p.r. skipped. 83aa9f0 already done. Looking forward. |
Did you look into these points? |
Yes, crud ttl already addressed. For the upload you can verify it in the handler implementation. It physically reads and processes the data into memory. First it read into engine memory, Then the handler explicitly copies those bytes into local buffer. const taken = @min(body.len, SINK_BYTES);
@memcpy(tl_sink[0..taken], body[0..taken]);Finally, the output is checked from const received: u64 = req.bodyReceived();
var body_buf: [COUNT_BUF]u8 = undefined;
const out = try std.fmt.bufPrint(&body_buf, "{d}", .{received});
try zix.Http1.sendSimpleFD(fd, @intFromEnum(zix.Http1.Status.Code.OK), zix.Http1.Content.Type.TEXT_PLAIN.asString(), out);Reference test of the size to be expected equal. Now for the json handler. It physically serializes the json payload per request, not caching the serialized string at startup (no initialize data cache in main). First it loads the dataset into engine memory as raw typed values (integers, strings, structs), not as pre-rendered json bytes. // dataset.zig
const items = try jzon.deserialize([]const Item, allocator, raw, .{
.strategy = .GENERATED,
.strings = .BORROW,
});Then the handler dynamically reads the request query parameter // json.zig
const multiplier: u64 = if (zix.Http1.queryParam(head, "m")) |raw|
std.fmt.parseInt(u64, raw, 10) catch 1
else
1;Finally, the handler serializes the json body on every single request into a local buffer (or directly into the engine's send buffer), and sends it. // json.zig
const body_len = renderBody(body, rows, count, multiplier) catch {
try response.badRequest(fd);
return;
};
// ... then sends it dynamicallyWhen the processing data fails, it will call |
|
Ok, great! I will take a look at it again, this entry takes some time to review because of the size of it. |
|
Sure. I'll keep updating from the main branch too. |
Description
zix entry for http1 using 0.5.x branch.
Update:
Checklist:
/benchmark -f zix/benchmark -f zix --save