This is a proof of concept with an expensive first visit, and this page is
the itemised bill. Every figure was measured on this machine by the code
that incurred it: the boot ledger by the service worker as it booted, the
timings below by asking this app the same question twice — once locally,
once over the network to the server. Nothing is quoted from a README,
nothing is rounded in our favour, and anything this browser will not report
is left blank rather than guessed.
Checking which runtime is serving this page…
The bundle
CRuby, Rails, the gems and this app, compiled to one WebAssembly module.
Counted byte by byte as it streamed into the compiler on the last boot this
browser recorded — MB here means 106 bytes.
app.wasm
the module the browser compiles
—
Over the network
what actually crossed the wire, compression included
—
Served from
the browser's own accounting, not an assumption
—
Boot
Two boots, told apart by what each one measured rather than by which visit
it was: a boot that pulled the bundle over the network, and a boot that
found it in the cache. The second column is what every visit after the
first one costs.
Phase
Bundle from network
Bundle from cache
Database openedPGlite — a Postgres in wasm, kept in IndexedDB
—
—
Bundle downloadedstreamed into the compiler as it arrived
—
—
CRuby compiledthe tail after the last byte; the rest overlapped the download
—
—
Rails bootedyour initializers and eager loads, in this tab
—
—
Schema preparedyour migrations, against the local Postgres
—
—
First page renderedGET / handled by Rails here, HTML only
—
—
Totalwall clock, first phase to a usable app
—
—
Recorded
—
—
This tab, right now
One Rails action, requested twice at the same moment: once by whatever
runtime is serving this page, once with the marker that sends it to the
server over the network. Same controller, same query, same write.
Measurement
Here
Server
Round triprequest to response, timed by this page
—
—
Query20 newest issues, timed inside Ruby
—
—
WriteINSERT plus its outbox row, rolled back — no COMMIT in this number
—
—
Differencederived: server round trip ÷ local round trip
—
Method
Measured. Bundle bytes are counted as the module streams
into the compiler. Boot phases are timed by the service worker around the
work itself. Round trips are timed by this page; the query and write
figures are timed inside Ruby, in the runtime that ran them.
Derived. Only the difference row — one measured number
divided by another. Bytes are shown in MB (106) from an exact
byte count.
Not measured. The write excludes its COMMIT, so it is a
floor rather than the whole cost of a durable write: committing would
leave a row behind and queue a mutation for the server, which this page
refuses to do to measure itself. Compression is only reported when the
browser reports it. Whether the bundle crossed the network comes from
resource timing; where a browser withholds that, the source cell stays
blank instead of assuming.
Repeatable. “Wipe local data and boot cold” drops the
caches and the service worker, then reloads into the splash, which deletes
the local database before installing a new worker — a page no worker
controls is the only thing that can. Two limits, both stated on the way
through: the browser's own HTTP cache is not ours to clear, so app.wasm may
still come from disk (which is why the ledger measures where the bundle came
from instead of inferring it), and a browser that will not release the old
database says so on the splash rather than booting on it and calling that a
first visit.
The code behind this pageRead live out of app.wasm — not a snippet