This repository was archived by the owner on Mar 24, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add x-gnosis framework (TypeScript/Node.js) #10888
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
57b9433
Add x-gnosis framework (TypeScript/Bun)
buley 097b91c
Add gnosis-uring framework (Rust, io_uring)
buley 0f7a6a5
fix(gnosis-uring): TechEmpower compliance — dynamic Content-Length + …
buley 73fdb3c
perf(gnosis-uring): replace .to_string() with itoa for zero-alloc Con…
buley 3eba969
feat(x-gnosis): add all 7 TechEmpower test types
buley 3f5a01a
fix(x-gnosis): spec compliance audit — Date header, Content-Type, doc…
buley 94308dc
test(x-gnosis): add 50 TechEmpower spec compliance tests
buley e31b23a
chore: remove unit tests from benchmark entry
buley 657fe7c
feat(gnosis-uring): add PostgreSQL support for all 7 TechEmpower tests
buley 3fc97f2
feat(x-gnosis): migrate from Bun to Node.js 22
buley 91df5f6
fix(gnosis-uring,x-gnosis): read PGPORT env var for local testing
buley e63f561
fix(gnosis-uring): fix SO_REUSEPORT for multi-thread whip-snaps
buley a06ea7c
perf(gnosis-uring): revert tokio-postgres, keep sync + whip-snaps
buley 6c8eb02
perf(gnosis-uring): raw PG wire protocol with cannon-style pipelining
buley df51289
perf(gnosis-uring): buffered I/O + prepared fortune statement
buley 3b37bd4
perf(gnosis-uring): binary PG results + zero-alloc message reads
buley d4288bf
perf(gnosis-uring): HTTP→PG pipeline rotation + reusable buffers
buley 79bb91b
perf(gnosis-uring): Unix domain socket + enum dispatch (no Box<dyn>)
buley 48383c2
perf(gnosis-uring): UDS enum dispatch + zero-alloc response builders
buley cb2bb0f
perf(gnosis-uring): fan-out PG connection pool for multi-query endpoints
buley c66b9c6
perf(gnosis-uring): poll-based RACE + thread oversubscription testing
buley ab80de9
feat(gnosis-uring): Lord of the Uring — async DB queries via io_uring
buley 082c45b
ci(gnosis-uring): Cloud Build benchmark config for Linux io_uring tes…
buley 11ff75d
fix(gnosis-uring): Linux compat (sa_family_t) + Cloud Build fixes
buley 1a621c7
fix(gnosis-uring): blocking DB in io_uring path (async DB deferred)
buley caf7bfd
fix(gnosis-uring): remove async PG dead code from io_uring path
buley 55e657e
perf(gnosis-uring): use whip-snaps (not io_uring) for TechEmpower
buley 78d2907
fix(gnosis-uring): remove remaining async PG references from event loop
buley 3d8076c
fix: remove last pg_state reference from Conn::new
buley dc40184
fix(gnosis-uring): Cloud Build PG auth — use trust instead of peer
buley 51a0218
fix(gnosis-uring): reduce PG pool to 2, bump max_connections to 200
buley 27931fe
feat(gnosis-uring): FORK/RACE/FOLD on the development itself
buley d67908b
refactor(x-gnosis): topology-driven server replaces switch statement
buley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| [package] | ||
| name = "gnosis-uring" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
| description = "Topology-driven HTTP server: four primitives (fork/race/fold/vent) mapped to io_uring" | ||
| license = "MPL-2.0" | ||
|
|
||
| [[bin]] | ||
| name = "gnosis-uring" | ||
| path = "src/main.rs" | ||
|
|
||
| [dependencies] | ||
| itoa = "1" | ||
| libc = "0.2" | ||
| flate2 = "1" | ||
| brotli = "7" | ||
| nanorand = { version = "0.7", default-features = false, features = ["std", "wyrand"] } | ||
|
|
||
| [target.'cfg(target_os = "linux")'.dependencies] | ||
| io-uring = "0.7" | ||
|
|
||
| [profile.release] | ||
| opt-level = 3 | ||
| lto = true | ||
| codegen-units = 1 | ||
| strip = true | ||
| panic = "abort" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # gnosis-uring | ||
|
|
||
| Topology-driven HTTP server with four primitives mapped directly to io_uring: | ||
|
|
||
| | Primitive | io_uring | Purpose | | ||
| |-----------|----------|---------| | ||
| | FORK | batch SQE submission | Accept connections, resolve files, race codecs | | ||
| | RACE | first CQE wins + cancel | Cache vs mmap vs disk, smallest codec wins | | ||
| | FOLD | gather CQEs | Headers + body, multi-frame responses | | ||
| | VENT | close fd, cancel ops | Timeout, error, connection close | | ||
|
|
||
| Features: | ||
| - Per-chunk Laminar codec racing (identity/gzip/brotli/deflate, smallest wins) | ||
| - SQPOLL mode (zero syscalls in hot path) | ||
| - Pinned buffers for stable io_uring SQE pointers | ||
| - UDP Aeon Flow transport (10-byte frames, no TCP overhead) | ||
|
|
||
| Whitepaper: https://forkracefold.com/ | ||
|
|
||
| ## Test URLs | ||
|
|
||
| - Plaintext: `http://localhost:8080/plaintext` | ||
| - JSON: `http://localhost:8080/json` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "framework": "gnosis-uring", | ||
| "tests": [{ | ||
| "default": { | ||
| "dockerfile": "gnosis-uring-uring.dockerfile", | ||
| "json_url": "/json", | ||
| "plaintext_url": "/plaintext", | ||
| "port": 8080, | ||
| "approach": "Realistic", | ||
| "classification": "Platform", | ||
| "language": "Rust", | ||
| "platform": "gnosis-uring", | ||
| "webserver": "gnosis-uring", | ||
| "os": "Linux", | ||
| "database_os": "Linux", | ||
| "database": "None", | ||
| "display_name": "gnosis-uring", | ||
| "notes": "Topology-driven server: four primitives (fork/race/fold/vent) mapped to io_uring. Pure io_uring mode for plaintext/JSON (no DB).", | ||
| "versus": "may-minihttp" | ||
| }, | ||
| "postgresql": { | ||
| "json_url": "/json", | ||
| "plaintext_url": "/plaintext", | ||
| "db_url": "/db", | ||
| "query_url": "/queries?queries=", | ||
| "update_url": "/updates?queries=", | ||
| "fortune_url": "/fortunes", | ||
| "cached_query_url": "/cached-queries?count=", | ||
| "port": 8080, | ||
| "approach": "Realistic", | ||
| "classification": "Platform", | ||
| "database": "Postgres", | ||
| "language": "Rust", | ||
| "platform": "gnosis-uring", | ||
| "webserver": "gnosis-uring", | ||
| "os": "Linux", | ||
| "database_os": "Linux", | ||
| "orm": "Raw", | ||
| "display_name": "gnosis-uring [PostgreSQL]", | ||
| "notes": "Topology-driven server with PostgreSQL: fork/race/fold/vent mapped to io_uring.", | ||
| "versus": "may-minihttp" | ||
| } | ||
| }] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| steps: | ||
| # Step 1: Build gnosis-uring | ||
| - name: 'rust:1.83-bookworm' | ||
| id: build | ||
| dir: '.' | ||
| entrypoint: bash | ||
| args: | ||
| - -c | ||
| - | | ||
| cargo build --release 2>&1 | ||
| ls -lh target/release/gnosis-uring | ||
| echo "Binary size: $(du -h target/release/gnosis-uring | cut -f1)" | ||
| file target/release/gnosis-uring | ||
|
|
||
| # Step 2: Benchmark with PostgreSQL | ||
| - name: 'debian:bookworm' | ||
| id: benchmark | ||
| dir: '.' | ||
| entrypoint: bash | ||
| args: | ||
| - -c | ||
| - | | ||
| set -e | ||
| apt-get update && apt-get install -y --no-install-recommends \ | ||
| postgresql postgresql-client liburing2 wrk curl procps | ||
|
|
||
| mkdir -p /tmp/www | ||
| echo '<html><body>Hello</body></html>' > /tmp/www/index.html | ||
|
|
||
| # Configure PostgreSQL for benchmark | ||
| echo "local all all trust" > /etc/postgresql/15/main/pg_hba.conf | ||
| echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/15/main/pg_hba.conf | ||
| echo "host all all ::1/128 trust" >> /etc/postgresql/15/main/pg_hba.conf | ||
| # Bump max_connections for 32 threads × 3 conns/thread = 96 | ||
| sed -i 's/max_connections = 100/max_connections = 200/' /etc/postgresql/15/main/postgresql.conf | ||
|
|
||
| # Start PostgreSQL | ||
| pg_ctlcluster 15 main start || true | ||
| sleep 3 | ||
|
|
||
| # Create TechEmpower database | ||
| su - postgres -c "createuser benchmarkdbuser" || true | ||
| su - postgres -c "psql -c \"ALTER USER benchmarkdbuser WITH PASSWORD 'benchmarkdbpass';\"" | ||
| su - postgres -c "createdb -O benchmarkdbuser hello_world" || true | ||
|
|
||
| cat > /tmp/seed.sql << 'SEEDEOF' | ||
| CREATE TABLE IF NOT EXISTS world (id integer PRIMARY KEY, randomnumber integer NOT NULL DEFAULT 0); | ||
| CREATE TABLE IF NOT EXISTS fortune (id integer PRIMARY KEY, message varchar(2048) NOT NULL); | ||
| INSERT INTO world (id, randomnumber) SELECT s, floor(random() * 10000 + 1)::int FROM generate_series(1, 10000) AS s ON CONFLICT DO NOTHING; | ||
| INSERT INTO fortune (id, message) VALUES | ||
| (1, 'fortune: No such file or directory'), | ||
| (2, 'A computer scientist is someone who fixes things that aren''t broken.'), | ||
| (3, 'After enough decimal places, nobody gives a damn.'), | ||
| (4, 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1'), | ||
| (5, 'A computer program does what you tell it to do, not what you want it to do.'), | ||
| (6, 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen'), | ||
| (7, 'Any program that runs right is obsolete.'), | ||
| (8, 'A list is only as strong as its weakest link. — Donald Knuth'), | ||
| (9, 'Feature: A bug with seniority.'), | ||
| (10, 'Computers make very fast, very accurate mistakes.'), | ||
| (11, E'<script>alert("This should not be displayed in a browser alert box.");</script>'), | ||
| (12, 'フレームワークのベンチマーク') | ||
| ON CONFLICT DO NOTHING; | ||
| GRANT ALL ON TABLE world TO benchmarkdbuser; | ||
| GRANT ALL ON TABLE fortune TO benchmarkdbuser; | ||
| SEEDEOF | ||
|
Comment on lines
+50
to
+66
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Amic no anam be !!! |
||
|
|
||
| su - postgres -c "psql -d hello_world -f /tmp/seed.sql" | ||
|
|
||
| echo "" | ||
| echo "══════════════════════════════════════════════════════════════" | ||
| echo "Lord of the Uring — GCP Cloud Build (bare metal Linux)" | ||
| echo "══════════════════════════════════════════════════════════════" | ||
| echo "CPU: $(lscpu | grep 'Model name' | sed 's/.*: *//')" | ||
| echo "Cores: $(nproc)" | ||
| echo "Kernel: $(uname -r)" | ||
|
|
||
| # Start gnosis-uring with multi-threaded whip-snaps (best for DB) | ||
| DBHOST=localhost ./target/release/gnosis-uring \ | ||
| --port 8080 --root /tmp/www --threads 0 & | ||
| sleep 3 | ||
|
|
||
| # Verify | ||
| echo "=== Verify ===" | ||
| curl -s http://localhost:8080/plaintext && echo "" | ||
| curl -s http://localhost:8080/json && echo "" | ||
| curl -s http://localhost:8080/db && echo "" | ||
| curl -s "http://localhost:8080/queries?queries=3" && echo "" | ||
| curl -s http://localhost:8080/fortunes | head -c 200 && echo "" | ||
| curl -s "http://localhost:8080/cached-queries?count=2" && echo "" | ||
|
|
||
| # Warmup | ||
| echo ""; echo "=== Warmup ===" | ||
| wrk -t16 -c512 -d5s http://localhost:8080/plaintext > /dev/null 2>&1 | ||
| wrk -t16 -c512 -d5s http://localhost:8080/db > /dev/null 2>&1 | ||
| echo "Done."; echo "" | ||
|
|
||
| # All 7 tests | ||
| for test in plaintext json db "queries?queries=20" fortunes "updates?queries=20" "cached-queries?count=20"; do | ||
| name=$(echo "$test" | cut -d'?' -f1 | tr '[:lower:]' '[:upper:]') | ||
| echo "=== $name — 16t, 512c, 15s ===" | ||
| wrk -t16 -c512 -d15s --latency "http://localhost:8080/$test" | ||
| echo "" | ||
| done | ||
|
|
||
| # High concurrency | ||
| echo "=== HIGH CONCURRENCY (1024c) ===" | ||
| for test in plaintext json db "queries?queries=20" fortunes "updates?queries=20" "cached-queries?count=20"; do | ||
| name=$(echo "$test" | cut -d'?' -f1 | tr '[:lower:]' '[:upper:]') | ||
| echo "=== $name (1024c) ===" | ||
| wrk -t16 -c1024 -d15s "http://localhost:8080/$test" | grep "Requests/sec" | ||
| done | ||
|
|
||
| echo "" | ||
| echo "=== HTTP PIPELINING (pipeline depth 16) ===" | ||
| cat > /tmp/pipeline.lua << 'LUAEOF' | ||
| init = function(args) | ||
| local r = {} | ||
| for i = 1, 16 do | ||
| r[i] = wrk.format(nil, "/plaintext") | ||
| end | ||
| req = table.concat(r) | ||
| end | ||
|
|
||
| request = function() | ||
| return req | ||
| end | ||
| LUAEOF | ||
| echo "=== PLAINTEXT PIPELINED ===" && wrk -t16 -c512 -d15s -s /tmp/pipeline.lua http://localhost:8080/plaintext | grep "Requests/sec" | ||
|
|
||
| echo "" | ||
| echo "══════════════════════════════════════════════════════════════" | ||
| echo "Lord of the Uring — benchmark complete" | ||
| echo "══════════════════════════════════════════════════════════════" | ||
|
|
||
| timeout: '1800s' | ||
| options: | ||
| machineType: 'E2_HIGHCPU_32' | ||
| diskSizeGb: 50 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 add yourself to the maintainers in the
benchmark_config.json.So with any change or marked as broken, you will be notified.
Example:
FrameworkBenchmarks/frameworks/Java/quarkus/benchmark_config.json
Lines 1 to 6 in 33531b8