Skip to content

Commit 57c0506

Browse files
Add live node benchmark comparison page (#81)
* Add live node benchmark comparison page * Update benchmark metadata fixture --------- Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
1 parent 10d7d04 commit 57c0506

11 files changed

Lines changed: 402 additions & 11 deletions

File tree

‎apps/web/public/llms.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [GPU earnings estimates](https://c0mpute.com/estimates): choose a GPU and compare illustrative monthly scenarios using public GPU rental rates and assumed paid utilization. These are not actual c0mpute payouts or guaranteed earnings; anonymized payout averages by GPU are not published yet.
1313
- [Market](https://c0mpute.com/market): GPU nodes online with each operator's listing. Fully competitive: every job is a sealed-bid auction under the buyer's cap and the lowest bid wins automatically; no rate card. `c0mpute pricing set --min <usd>` = dynamic pricing (starts at 60% of the cap, undercuts the winning price by 2% after a loss, probes up after a win, rises with queue load) never under the floor; 5% market fee on market jobs; `--fixed <usd>` = one price. The listing (`pricing: {mode, min_usd, fixed_usd}`) is in https://c0mpute.com/api/nodes.
1414
- [Node board](https://c0mpute.com/nodes): every node online now, ranked by `c0mpute bench` score. JSON at https://c0mpute.com/api/nodes.
15+
- [Benchmarks](https://c0mpute.com/benchmark): live CPU, cores, RAM, composite score and per-workload throughput for online nodes. These synthetic CPU workloads do not measure AI model inference speed.
1516
- Referral links: https://c0mpute.com/r/<handle> gives an install line with `C0MPUTE_REF=<handle>`; nodes installed with it show the handle on the board. Public scoreboard, no payout.
1617

1718
## Docs
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
import Link from "next/link";
2+
import { getNodesPayload } from "@/lib/nodes";
3+
import type { BenchSample, NodeRow, WorkloadBenchmark } from "@/lib/nodes";
4+
5+
export const metadata = {
6+
title: "benchmarks — c0mpute",
7+
description:
8+
"Compare c0mpute node hardware and CPU benchmark performance across fibonacci, matrix multiply and BLAKE3 workloads.",
9+
alternates: { canonical: "https://c0mpute.com/benchmark" },
10+
};
11+
12+
export const dynamic = "force-dynamic";
13+
14+
const WORKLOADS = [
15+
{ id: "fib", name: "fibonacci", description: "recursive CPU work and call overhead", unit: "visits/s" },
16+
{ id: "matmul", name: "matrix multiply", description: "floating point throughput and cache", unit: "FLOP/s" },
17+
{ id: "hash", name: "BLAKE3 hash", description: "hash throughput and memory bandwidth", unit: "bytes/s" },
18+
] as const;
19+
20+
function bestSample(workload: WorkloadBenchmark): BenchSample | undefined {
21+
return workload.samples.reduce<BenchSample | undefined>(
22+
(best, sample) => (!best || sample.throughput > best.throughput ? sample : best),
23+
undefined,
24+
);
25+
}
26+
27+
function formatRate(id: string, rate: number): string {
28+
if (id === "fib") {
29+
if (rate >= 1e9) return `${(rate / 1e9).toFixed(2)} G visits/s`;
30+
if (rate >= 1e6) return `${(rate / 1e6).toFixed(1)} M visits/s`;
31+
return `${rate.toFixed(0)} visits/s`;
32+
}
33+
if (id === "matmul") return `${(rate / 1e9).toFixed(2)} GFLOP/s`;
34+
return `${(rate / (1024 ** 3)).toFixed(2)} GiB/s`;
35+
}
36+
37+
function formatRam(bytes: number | null): string {
38+
return bytes == null ? "—" : `${(bytes / (1024 ** 3)).toFixed(1)} GiB`;
39+
}
40+
41+
function formatDuration(microseconds: number): string {
42+
if (microseconds < 1000) return `${microseconds} μs`;
43+
if (microseconds < 1_000_000) return `${(microseconds / 1000).toFixed(1)} ms`;
44+
return `${(microseconds / 1_000_000).toFixed(2)} s`;
45+
}
46+
47+
function formatDate(value: string | null): string {
48+
if (!value) return "—";
49+
const date = new Date(value);
50+
return Number.isNaN(date.getTime())
51+
? value
52+
: new Intl.DateTimeFormat("en", {
53+
dateStyle: "medium",
54+
timeStyle: "short",
55+
timeZone: "UTC",
56+
}).format(date) + " UTC";
57+
}
58+
59+
function NodeLabel({ node }: { node: NodeRow }) {
60+
return (
61+
<span className="font-mono">
62+
<span className="accent">{node.id}</span>
63+
<span className="block text-[var(--color-dim)]">{node.cpu || node.class}</span>
64+
</span>
65+
);
66+
}
67+
68+
function PerformanceTable({
69+
workload,
70+
nodes,
71+
}: {
72+
workload: (typeof WORKLOADS)[number];
73+
nodes: NodeRow[];
74+
}) {
75+
const rows = nodes.flatMap((node) => {
76+
const result = node.benchmarks?.[workload.id];
77+
const peak = result ? bestSample(result) : undefined;
78+
const single = result?.samples.find((sample) => sample.threads === 1);
79+
return peak ? [{ node, result: result!, peak, single }] : [];
80+
});
81+
82+
return (
83+
<section className="space-y-3" id={workload.id}>
84+
<header className="space-y-1">
85+
<h2 className="text-sm font-semibold">[ {workload.name} ]</h2>
86+
<p className="text-xs text-[var(--color-dim)]">
87+
{workload.description} · higher is better · {workload.unit}
88+
</p>
89+
</header>
90+
{rows.length === 0 ? (
91+
<p className="text-sm text-[var(--color-dim)]">No detailed {workload.name} results published yet.</p>
92+
) : (
93+
<div className="overflow-x-auto border border-[var(--color-rule)] rounded">
94+
<table className="w-full min-w-[800px] text-left border-collapse text-xs">
95+
<thead className="text-[var(--color-dim)] bg-[var(--color-card)]">
96+
<tr>
97+
<th className="p-3">node / CPU</th>
98+
<th className="p-3">input</th>
99+
<th className="p-3">1 thread</th>
100+
<th className="p-3">best throughput</th>
101+
<th className="p-3">threads</th>
102+
<th className="p-3">speedup</th>
103+
<th className="p-3">run time</th>
104+
</tr>
105+
</thead>
106+
<tbody className="divide-y divide-[var(--color-rule)]">
107+
{rows.map(({ node, result, peak, single }) => (
108+
<tr key={node.id}>
109+
<td className="p-3"><NodeLabel node={node} /></td>
110+
<td className="p-3">{result.params || "—"}</td>
111+
<td className="p-3">{single ? formatRate(workload.id, single.throughput) : "—"}</td>
112+
<td className="p-3 accent">{formatRate(workload.id, peak.throughput)}</td>
113+
<td className="p-3">{peak.threads}</td>
114+
<td className="p-3">{peak.speedup.toFixed(2)}×</td>
115+
<td className="p-3">{formatDuration(peak.duration_us)}</td>
116+
</tr>
117+
))}
118+
</tbody>
119+
</table>
120+
</div>
121+
)}
122+
</section>
123+
);
124+
}
125+
126+
export default async function BenchmarkPage() {
127+
const payload = await getNodesPayload();
128+
const nodes = payload.nodes;
129+
const benchmarked = nodes.filter((node) => node.bench_score != null);
130+
const detailed = nodes.filter((node) => node.benchmarks && Object.keys(node.benchmarks).length > 0);
131+
132+
return (
133+
<main className="max-w-5xl mx-auto px-6 py-16 space-y-10">
134+
<header className="space-y-2">
135+
<div className="flex flex-wrap items-baseline justify-between gap-3">
136+
<h1 className="text-2xl font-bold accent">benchmarks</h1>
137+
<Link href="/nodes" className="text-xs">← live node board</Link>
138+
</div>
139+
<p className="comment">// hardware and measured CPU throughput from online nodes</p>
140+
</header>
141+
142+
<section className="grid gap-4 sm:grid-cols-3">
143+
<div className="border border-[var(--color-rule)] rounded p-4">
144+
<div className="text-xs text-[var(--color-dim)]">online nodes</div>
145+
<div className="text-xl accent mt-1">{payload.workers_online.toLocaleString()}</div>
146+
</div>
147+
<div className="border border-[var(--color-rule)] rounded p-4">
148+
<div className="text-xs text-[var(--color-dim)]">with score</div>
149+
<div className="text-xl accent mt-1">{benchmarked.length.toLocaleString()}</div>
150+
</div>
151+
<div className="border border-[var(--color-rule)] rounded p-4">
152+
<div className="text-xs text-[var(--color-dim)]">with detailed results</div>
153+
<div className="text-xl accent mt-1">{detailed.length.toLocaleString()}</div>
154+
</div>
155+
</section>
156+
157+
<section className="space-y-3">
158+
<h2 className="text-sm font-semibold">[ hardware ]</h2>
159+
{nodes.length === 0 ? (
160+
<p className="text-sm text-[var(--color-dim)]">
161+
{payload.source === "unavailable" ? "The node aggregator is not answering." : "No nodes are online."}
162+
</p>
163+
) : (
164+
<div className="overflow-x-auto border border-[var(--color-rule)] rounded">
165+
<table className="w-full min-w-[800px] text-left border-collapse text-xs">
166+
<thead className="text-[var(--color-dim)] bg-[var(--color-card)]">
167+
<tr>
168+
<th className="p-3">node / CPU model</th>
169+
<th className="p-3">class</th>
170+
<th className="p-3">cores</th>
171+
<th className="p-3">RAM</th>
172+
<th className="p-3">score</th>
173+
<th className="p-3">bench run</th>
174+
</tr>
175+
</thead>
176+
<tbody className="divide-y divide-[var(--color-rule)]">
177+
{nodes.map((node) => (
178+
<tr key={node.id}>
179+
<td className="p-3"><NodeLabel node={node} /></td>
180+
<td className="p-3">{node.class}</td>
181+
<td className="p-3">{node.cores ?? "—"}</td>
182+
<td className="p-3">{formatRam(node.ram_bytes)}</td>
183+
<td className="p-3 accent">{node.bench_score?.toLocaleString() ?? "—"}</td>
184+
<td className="p-3 text-[var(--color-dim)]">{formatDate(node.bench_at)}</td>
185+
</tr>
186+
))}
187+
</tbody>
188+
</table>
189+
</div>
190+
)}
191+
{nodes.some((node) => !node.ram_bytes || !node.benchmarks) && (
192+
<p className="text-xs text-[var(--color-dim)] leading-6">
193+
Some online nodes have older or score-only adverts. Their detailed results and RAM appear after the node updates and publishes a full <code>c0mpute bench</code> report.
194+
</p>
195+
)}
196+
</section>
197+
198+
<section className="space-y-3 border border-[var(--color-rule)] rounded p-4 text-sm leading-7">
199+
<h2 className="text-sm font-semibold">[ reading the score ]</h2>
200+
<p>
201+
The score combines each node&apos;s best fib, matrix multiply and BLAKE3 throughput as a geometric mean against fixed reference rates. <strong>1000</strong> means one reference core&apos;s throughput on all three workloads. It is a relative CPU capacity score, not a percentage or an AI model tokens/sec measurement.
202+
</p>
203+
<p className="text-[var(--color-dim)]">
204+
Fib counts recursive calls per second; matrix multiply reports floating point operations per second; BLAKE3 reports bytes hashed per second. The thread count and speedup show how each workload scales on that machine. c0mpute does not currently publish per-AI-model inference benchmarks here.
205+
</p>
206+
</section>
207+
208+
{WORKLOADS.map((workload) => (
209+
<PerformanceTable key={workload.id} workload={workload} nodes={nodes} />
210+
))}
211+
212+
<footer className="text-xs text-[var(--color-dim)]">
213+
Live data from the public node adverts · <Link href="/api/nodes">JSON API</Link> · refresh with <code>c0mpute bench</code> on a node.
214+
</footer>
215+
</main>
216+
);
217+
}

‎apps/web/src/app/docs/page.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,10 @@ c0mpute doctor --report # send anonymized telemetry`}
288288
<P>
289289
The worker reads the score at start and publishes it as{" "}
290290
<code>bench_score</code> in its capability ad, so buyers and the{" "}
291-
<Link href="/status">network status</Link> page see measured capacity
292-
rather than a GPU tag alone. Quick runs are for a sanity check and
293-
are never advertised.
291+
<Link href="/status">network status</Link> page see measured capacity.
292+
The <Link href="/benchmark">benchmark board</Link> shows CPU, cores,
293+
RAM and per-workload throughput for online nodes. Quick runs are for a
294+
sanity check and are never advertised.
294295
</P>
295296
<Code>
296297
{`c0mpute bench # full run, saves + prints the table

‎apps/web/src/app/nodes/page.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export default async function NodesPage() {
5050
</p>
5151
</section>
5252

53+
<p className="text-xs text-[var(--color-dim)]">
54+
See <Link href="/benchmark">hardware details and per-workload benchmarks</Link>.
55+
</p>
56+
5357
<section className="space-y-3">
5458
<h2 className="text-sm font-semibold">[ board ]</h2>
5559
{p.nodes.length === 0 ? (

‎apps/web/src/app/sitemap.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const staticPages: MetadataRoute.Sitemap = [
1616
{ url: `${BASE}/status`, priority: 0.6, changeFrequency: "hourly" },
1717
{ url: `${BASE}/market`, priority: 0.9, changeFrequency: "hourly" },
1818
{ url: `${BASE}/nodes`, priority: 0.7, changeFrequency: "hourly" },
19+
{ url: `${BASE}/benchmark`, priority: 0.8, changeFrequency: "hourly" },
1920
{ url: `${BASE}/about`, priority: 0.7, changeFrequency: "monthly" },
2021
{ url: `${BASE}/pricing`, priority: 0.8, changeFrequency: "monthly" },
2122
{ url: `${BASE}/estimates`, priority: 0.9, changeFrequency: "weekly" },

‎apps/web/src/components/site-nav.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const LINKS: { href: string; label: string; accent?: boolean }[] = [
1111
{ href: "/estimates", label: "GPU earnings", accent: true },
1212
{ href: "/market", label: "market" },
1313
{ href: "/nodes", label: "nodes" },
14+
{ href: "/benchmark", label: "benchmarks" },
1415
{ href: "/agents", label: "agents" },
1516
{ href: "/plugins", label: "plugins" },
1617
{ href: "/docs", label: "docs" },

‎apps/web/src/lib/nodes.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,31 @@ import { fetchFromAggregators } from "./aggregators";
55
export interface NodeRow {
66
id: string;
77
class: string;
8+
cpu: string | null;
89
cores: number | null;
10+
ram_bytes: number | null;
911
bench_score: number | null;
12+
bench_at: string | null;
13+
benchmarks: Record<string, WorkloadBenchmark> | null;
1014
version: string | null;
1115
ref: string | null;
1216
/** The operator's listing; absent on nodes older than 0.2.35. */
1317
pricing?: Pricing | null;
1418
last_seen_s: number;
1519
}
1620

21+
export interface BenchSample {
22+
threads: number;
23+
duration_us: number;
24+
speedup: number;
25+
throughput: number;
26+
}
27+
28+
export interface WorkloadBenchmark {
29+
params: string;
30+
samples: BenchSample[];
31+
}
32+
1733
/** How a node prices its bids, set by its operator with `c0mpute pricing set`. */
1834
export interface Pricing {
1935
mode: "dynamic" | "fixed";

‎node/crates/c0mpute-bench/src/lib.rs‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ pub struct Metadata {
6060
pub start_time: String,
6161
pub cpu: String,
6262
pub cores: usize,
63+
#[serde(default, skip_serializing_if = "Option::is_none")]
64+
pub ram_bytes: Option<u64>,
6365
pub kernel: String,
6466
pub compiler: String,
6567
/// c0mpute version that produced the report.
@@ -158,12 +160,13 @@ pub fn run(opts: &Options) -> BenchReport {
158160
let mut results = BTreeMap::new();
159161
results.insert(RUNTIME.to_string(), per_workload);
160162

161-
let (cpu, kernel) = host_info();
163+
let (cpu, kernel, ram_bytes) = host_info();
162164
let mut report = BenchReport {
163165
metadata: Metadata {
164166
start_time,
165167
cpu,
166168
cores,
169+
ram_bytes,
167170
kernel,
168171
compiler: env!("C0MPUTE_RUSTC_VERSION").to_string(),
169172
version: env!("CARGO_PKG_VERSION").to_string(),
@@ -515,6 +518,12 @@ pub fn render_text(report: &BenchReport) -> String {
515518
));
516519
out.push_str(&format!(" cpu {}\n", m.cpu));
517520
out.push_str(&format!(" cores {}\n", m.cores));
521+
if let Some(bytes) = m.ram_bytes {
522+
out.push_str(&format!(
523+
" ram {:.1} GiB\n",
524+
bytes as f64 / (1024.0 * 1024.0 * 1024.0)
525+
));
526+
}
518527
out.push_str(&format!(" kernel {}\n", m.kernel));
519528
out.push_str(&format!(" compiler {}\n", m.compiler));
520529
out.push_str(&format!(
@@ -576,10 +585,11 @@ pub fn human_rate(workload: &str, per_sec: f64) -> String {
576585
// Host info
577586
// ────────────────────────────────────────────────────────────────────────
578587

579-
fn host_info() -> (String, String) {
588+
fn host_info() -> (String, String, Option<u64>) {
580589
use sysinfo::System;
581590
let mut sys = System::new();
582591
sys.refresh_cpu_all();
592+
sys.refresh_memory();
583593
let cpu = sys
584594
.cpus()
585595
.first()
@@ -593,7 +603,8 @@ fn host_info() -> (String, String) {
593603
)
594604
.trim()
595605
.to_string();
596-
(cpu, kernel)
606+
let ram_bytes = (sys.total_memory() > 0).then_some(sys.total_memory());
607+
(cpu, kernel, ram_bytes)
597608
}
598609

599610
fn rfc3339_now() -> String {
@@ -758,6 +769,7 @@ mod tests {
758769
start_time: String::new(),
759770
cpu: String::new(),
760771
cores: 1,
772+
ram_bytes: None,
761773
kernel: String::new(),
762774
compiler: String::new(),
763775
version: String::new(),

‎node/crates/c0mpute-cli/src/main.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,9 @@ fn install_tui() -> Result<()> {
19661966
exec \"$BUN\" run \"{}/src/index.ts\" \"$@\"\n",
19671967
tui_dir.display()
19681968
);
1969+
if let Some(parent) = wrapper.parent() {
1970+
std::fs::create_dir_all(parent).context("create launcher directory")?;
1971+
}
19691972
std::fs::write(&wrapper, body).map_err(|e| anyhow::anyhow!("write launcher: {e}"))?;
19701973
#[cfg(unix)]
19711974
{

0 commit comments

Comments
 (0)