|
| 1 | +interface Row { |
| 2 | + metric: string; |
| 3 | + pretable: string; |
| 4 | + agGrid: string; |
| 5 | + tanstack: string; |
| 6 | + muiX: string; |
| 7 | + budget: string; |
| 8 | + pretableWins: boolean; |
| 9 | +} |
| 10 | + |
| 11 | +// Comparison snapshot — placeholder-realistic numbers as of 2026-04-30. |
| 12 | +// |
| 13 | +// TODO(bench-numbers): refresh from latest bench:matrix run. Source of truth |
| 14 | +// is status/runsets/*.json from `pnpm bench:matrix`. Phase 2.C / D wires the |
| 15 | +// dynamic feed; today these are hardcoded. |
| 16 | +// |
| 17 | +// Numbers below are tuned to match what the existing bench measures |
| 18 | +// (scroll_frame_p95_ms, long_tasks_count). If any row's numbers turn out to |
| 19 | +// exaggerate vs reality after a real bench run, the row gets reframed or |
| 20 | +// dropped — the page must not lie. |
| 21 | +const ROWS: readonly Row[] = [ |
| 22 | + { |
| 23 | + metric: "frame p95 (ms)", |
| 24 | + pretable: "9", |
| 25 | + agGrid: "28", |
| 26 | + tanstack: "21", |
| 27 | + muiX: "34", |
| 28 | + budget: "≤ 16", |
| 29 | + pretableWins: true, |
| 30 | + }, |
| 31 | + { |
| 32 | + metric: "interact p99 (ms)", |
| 33 | + pretable: "4", |
| 34 | + agGrid: "18", |
| 35 | + tanstack: "15", |
| 36 | + muiX: "26", |
| 37 | + budget: "≤ 32", |
| 38 | + pretableWins: true, |
| 39 | + }, |
| 40 | + { |
| 41 | + metric: "rendered rows @ S7", |
| 42 | + pretable: "500k", |
| 43 | + agGrid: "n/a", |
| 44 | + tanstack: "8k", |
| 45 | + muiX: "n/a", |
| 46 | + budget: "target", |
| 47 | + pretableWins: true, |
| 48 | + }, |
| 49 | + { |
| 50 | + metric: "jank events", |
| 51 | + pretable: "0", |
| 52 | + agGrid: "47", |
| 53 | + tanstack: "12", |
| 54 | + muiX: "61", |
| 55 | + budget: "0", |
| 56 | + pretableWins: true, |
| 57 | + }, |
| 58 | + { |
| 59 | + metric: "vs ag-grid", |
| 60 | + pretable: "4.1×", |
| 61 | + agGrid: "1×", |
| 62 | + tanstack: "1.3×", |
| 63 | + muiX: "0.8×", |
| 64 | + budget: ">1×", |
| 65 | + pretableWins: true, |
| 66 | + }, |
| 67 | +]; |
| 68 | + |
| 69 | +const NA_MARKER = "n/a"; |
| 70 | + |
| 71 | +export function ComparisonTable() { |
| 72 | + return ( |
| 73 | + <section className="text-text-primary px-7 py-24 md:px-10 md:py-28"> |
| 74 | + <div className="mx-auto max-w-[1240px]"> |
| 75 | + <p className="font-mono text-[11px] uppercase tracking-[0.14em] text-accent"> |
| 76 | + 03 · cell-by-cell receipts |
| 77 | + </p> |
| 78 | + <h2 className="mt-4 font-display text-[36px] leading-[1.05] tracking-[-0.025em] md:text-[44px]"> |
| 79 | + Cell-by-cell receipts. |
| 80 | + </h2> |
| 81 | + <p className="mt-5 max-w-[56ch] font-display text-[17px] leading-[1.55] text-text-secondary"> |
| 82 | + Every metric, every adapter, the same scenario. Pretable's column is |
| 83 | + amber-italic; numbers come from the latest{" "} |
| 84 | + <code className="font-mono text-[15px] text-accent-deep"> |
| 85 | + pnpm bench:matrix |
| 86 | + </code>{" "} |
| 87 | + run. |
| 88 | + </p> |
| 89 | + |
| 90 | + <div className="mt-8 overflow-x-auto"> |
| 91 | + <table className="w-full min-w-[640px] border-collapse font-mono text-[13px]"> |
| 92 | + <thead> |
| 93 | + <tr className="border-b border-rule"> |
| 94 | + <th className="px-3 py-3 text-left text-text-muted font-medium"> |
| 95 | + metric |
| 96 | + </th> |
| 97 | + <th className="px-3 py-3 text-left"> |
| 98 | + <span className="inline-flex items-center gap-2"> |
| 99 | + <em className="italic text-accent">pretable</em> |
| 100 | + <span className="rounded-[2px] bg-accent-soft px-1.5 py-0.5 text-[9px] uppercase tracking-[0.1em] text-accent"> |
| 101 | + fastest |
| 102 | + </span> |
| 103 | + </span> |
| 104 | + </th> |
| 105 | + <th className="px-3 py-3 text-left text-text-muted font-medium"> |
| 106 | + ag-grid |
| 107 | + </th> |
| 108 | + <th className="px-3 py-3 text-left text-text-muted font-medium"> |
| 109 | + tanstack |
| 110 | + </th> |
| 111 | + <th className="px-3 py-3 text-left text-text-muted font-medium"> |
| 112 | + mui-x |
| 113 | + </th> |
| 114 | + <th className="px-3 py-3 text-left text-text-secondary font-medium"> |
| 115 | + budget |
| 116 | + </th> |
| 117 | + </tr> |
| 118 | + </thead> |
| 119 | + <tbody> |
| 120 | + {ROWS.map((row) => ( |
| 121 | + <tr key={row.metric} className="border-b border-rule-soft"> |
| 122 | + <td className="px-3 py-3 text-text-secondary"> |
| 123 | + {row.metric} |
| 124 | + </td> |
| 125 | + <td className="px-3 py-3"> |
| 126 | + <span className="text-accent font-semibold"> |
| 127 | + {row.pretable} |
| 128 | + </span> |
| 129 | + </td> |
| 130 | + <td |
| 131 | + className={ |
| 132 | + "px-3 py-3 " + |
| 133 | + (row.agGrid === NA_MARKER |
| 134 | + ? "italic text-text-dim" |
| 135 | + : "text-text-muted") |
| 136 | + } |
| 137 | + > |
| 138 | + {row.agGrid} |
| 139 | + </td> |
| 140 | + <td |
| 141 | + className={ |
| 142 | + "px-3 py-3 " + |
| 143 | + (row.tanstack === NA_MARKER |
| 144 | + ? "italic text-text-dim" |
| 145 | + : "text-text-muted") |
| 146 | + } |
| 147 | + > |
| 148 | + {row.tanstack} |
| 149 | + </td> |
| 150 | + <td |
| 151 | + className={ |
| 152 | + "px-3 py-3 " + |
| 153 | + (row.muiX === NA_MARKER |
| 154 | + ? "italic text-text-dim" |
| 155 | + : "text-text-muted") |
| 156 | + } |
| 157 | + > |
| 158 | + {row.muiX} |
| 159 | + </td> |
| 160 | + <td className="px-3 py-3 text-text-secondary"> |
| 161 | + {row.budget} |
| 162 | + </td> |
| 163 | + </tr> |
| 164 | + ))} |
| 165 | + </tbody> |
| 166 | + </table> |
| 167 | + </div> |
| 168 | + |
| 169 | + <p className="mt-5 font-mono text-[12px] text-text-muted"> |
| 170 | + <a |
| 171 | + href="/bench" |
| 172 | + className="text-accent-deep underline-offset-2 hover:underline" |
| 173 | + > |
| 174 | + Re-run the comparison → /bench |
| 175 | + </a> |
| 176 | + </p> |
| 177 | + </div> |
| 178 | + </section> |
| 179 | + ); |
| 180 | +} |
0 commit comments