From 768317d789a01d722fe7455d792fed11e6579b5c Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sat, 26 Sep 2026 16:56:08 +0100 Subject: Benchmark an app served by its views and inputs run.py --suite app serves the scoreboard of scores.aup (22 lines of aup) with pure-serve against the same scoreboard written by hand in axum and drogon: POST /inputs/score?points=N with a name as the body, GET /views/total and a page of 20 rows as JSON. Durable, the baselines append each score to a log and fdatasync it before answering (replayed at start); the load generator learns the three requests. --- benchmarks/http/scores.aup | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 benchmarks/http/scores.aup (limited to 'benchmarks/http/scores.aup') diff --git a/benchmarks/http/scores.aup b/benchmarks/http/scores.aup new file mode 100644 index 0000000..8683bf2 --- /dev/null +++ b/benchmarks/http/scores.aup @@ -0,0 +1,22 @@ +# The scoreboard of the app benchmarks (run.py --suite app), which the axum +# and drogon baselines write by hand: pure-serve serves its views and inputs, +# with no routes, handlers or storage code written. +record Entry { + name: text + points = 0 +} +state board: list of Entry by name +input score = message { + points: u32 + name: bytes +} +on score { + if !board.has(text(score.name)) { board.add(Entry { name: text(score.name) }) } + board[text(score.name)].points = board[text(score.name)].points + score.points + reply score.name +} +view total = sum(e.points for e in board) +view leaders = each e in board { + name = e.name + points = e.points +} -- cgit v1.2.3