MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / BenchmarkPage

Function BenchmarkPage

docs/src/pages/benchmark.tsx:36–292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36export default function BenchmarkPage(): React.JSX.Element {
37 const largestRow = benchmarkSnapshot.rows[benchmarkSnapshot.rows.length - 1]
38 const strongestMountWin = benchmarkSnapshot.rows.reduce((best, row) =>
39 row.mountDeltaMs < best.mountDeltaMs ? row : best,
40 )
41 const strongestMemoryWin = benchmarkSnapshot.rows.reduce((best, row) =>
42 row.mountMemDeltaKiB < best.mountMemDeltaKiB ? row : best,
43 )
44 const smallestCount = benchmarkSnapshot.rows[0]?.count ?? 0
45
46 return (
47 <Layout
48 title="Benchmark Results"
49 description="Benchmark comparison between React Tooltip V5 and V6."
50 >
51 <header className={styles.hero}>
52 <div className="container">
53 <div className={styles.heroInner}>
54 <div>
55 <p className={styles.eyebrow}>Benchmark</p>
56 <h1 className={styles.title}>V5 vs V6</h1>
57 <p className={styles.subtitle}>
58 A version-to-version benchmark focused on the runtime cost of React Tooltip v6
59 relative to v5 under the same workloads.
60 </p>
61 <div className={styles.meta}>
62 <span className={styles.metaBadge}>{benchmarkSnapshot.inputFiles} runs</span>
63 <span className={styles.metaBadge}>v{benchmarkSnapshot.versions.v5}</span>
64 <span className={styles.metaBadge}>v{benchmarkSnapshot.versions.v6}</span>
65 <span className={styles.metaBadge}>
66 {smallestCount.toLocaleString()} to {largestRow.count.toLocaleString()} anchors
67 </span>
68 </div>
69 </div>
70 </div>
71 </div>
72 </header>
73
74 <main className={styles.page}>
75 <div className="container">
76 <section className={styles.summaryGrid}>
77 <article className={styles.summaryCard}>
78 <p className={styles.summaryLabel}>Best Mount Improvement</p>
79 <strong className={styles.summaryValue}>
80 {formatDeltaMs(strongestMountWin.mountDeltaMs)}
81 </strong>
82 <p className={styles.summaryText}>
83 v6 mounts fastest relative to v5 at {strongestMountWin.count.toLocaleString()}{' '}
84 anchors in the current snapshot.
85 </p>
86 </article>
87 <article className={styles.summaryCard}>
88 <p className={styles.summaryLabel}>Best Memory Reduction</p>
89 <strong className={styles.summaryValue}>
90 {formatMemory(strongestMemoryWin.mountMemDeltaKiB)}
91 </strong>
92 <p className={styles.summaryText}>
93 v6 retains less mount-time memory than v5 at{' '}

Callers

nothing calls this directly

Calls 4

formatDeltaMsFunction · 0.85
formatMemoryFunction · 0.85
getDeltaClassFunction · 0.85
formatPercentFunction · 0.70

Tested by

no test coverage detected