Skip to content

Dozreg/book2#958

Closed
dozreg-toplud wants to merge 27 commits intoml/bookfrom
dozreg/book2
Closed

Dozreg/book2#958
dozreg-toplud wants to merge 27 commits intoml/bookfrom
dozreg/book2

Conversation

@dozreg-toplud
Copy link
Contributor

This should build on windows

pkova and others added 27 commits January 20, 2026 18:23
Previously we were using the unix assembly files with the SystemV calling
convention. This predictably leads to crashes when running these jets on
Windows, something that happens immediately when someone sends you a directed
messaging packet. Here we switch to the Windows x64 calling convention assembly
files that libblake3 so graciously provides.
Previously we were exclusively using unix assembly files with the
SystemV calling convention. This predictably leads to crashes when
running these jets on Windows, something that happens immediately when
someone sends you a directed messaging packet. Here we switch to the
Windows x64 calling convention assembly files that libblake3 so
graciously provides.
Adds a compression handler, configured to support gzip and brotli for
responses of non-trivial size.

The library takes care of applying compression only on content types
where this makes sense. For now, we're deferring to h2o's defaults,
which is essentially a whitelist containing most common text-based
mime types.

We lightly adjust the `h2o_add_header_by_str` call so that h2o tokenizes
our headers appropriately, letting it detect the content type.
Adds a compression handler, configured to support gzip and brotli for
responses of non-trivial size.

The library takes care of applying compression only on content types
where this makes sense. For now, we're deferring to h2o's defaults,
which is essentially a whitelist containing most common text-based mime
types.

We lightly adjust the `h2o_add_header_by_str` call so that h2o tokenizes
our headers appropriately, letting it detect the content type.

With this change, we see bytes-over-the-wire reduced as expected.
A cache refresh of the groups web client on a ship with very little
content (so, primarily .js file downloads) goes down from ~10mb to ~3mb
transferred. (~30%)
Filling a channel with small posts by the same author gives a "recent
posts" json scry result of ~23kb, but only uses ~3kb over the wire.
(~13%!)

Happy to bikeshed the compression configuration here. I just picked
values that seemed fairly middle-of-the-road.
The primary reason to upgrade lmdb here is the fact that latest master LMDB uses
the NtCreateSection api to implement sparse files on windows. With the current
windows binary every epoch immediately writes a 63 GB data.mdb file to disk
which is less than ideal.

Unfortunately there's no tagged release out with this fix, but this repository
changes very infrequently and the LMDB guys know what they are doing so I
determine the risk of upgrading here to be quite low.

We also get
LMDB/lmdb@82c5609
as a bonus with a fix for macos fsync so we can get rid of our patched mdb.c.
The primary reason to upgrade lmdb here is the fact that latest master
LMDB uses the NtCreateSection api to implement sparse files on windows.
With the current windows binary every epoch immediately writes a 63 GB
data.mdb file to disk which is less than ideal.

Unfortunately there's no tagged release out with this fix, but this
repository changes very infrequently and the LMDB guys know what they
are doing so I determine the risk of upgrading here to be quite low.

We also get

LMDB/lmdb@82c5609
as a bonus with a fix for macos fsync so we can get rid of our patched
mdb.c.
Adds a `--gc-abort` flag which causes the runtime to crash if a leak is
encountered, and replaces `--gc` in the testing bash script with that
flag.

Since the tests already run in CI with `--gc` and `-Dmem-dbg`, replacing
that flag with `--gc-abort` would allow to catch memory leaks earlier in
development
This `c3_free` call is left from before the mars-urth split when the
struct was heap-allocated
@dozreg-toplud dozreg-toplud requested a review from a team as a code owner February 5, 2026 14:32
@matthew-levan
Copy link
Contributor

Thanks @dozreg-toplud, I cherry-picked the pertinent commits so that we don't duplicate commits from two merges of develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants