Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ members = [
]

[workspace.package]
version = "0.1.23"
version = "0.1.24"
edition = "2021"
authors = ["Evan McGrane"]
license = "MIT"
Expand Down
Binary file added docs/public/favicons/bench-favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions docs/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "viemgolem · Go Interface for Ethereum",
"short_name": "viem-go golem",
"description": "Build reliable blockchain apps & libraries with idiomatic Go, type-safe and composable modules that interface with Ethereum — inspired by viem",
"name": "poly-bench · Write Once, Benchmark Everywhere",
"short_name": "poly-bench",
"description": "A cross-language benchmarking framework. Write benchmarks once in a clean DSL and run them natively across Go, TypeScript, Rust, and more.",
"start_url": "/",
"display": "standalone",
"background_color": "#0a0a0a",
"theme_color": "#3991cd",
"orientation": "portrait-primary",
"icons": [
{
"src": "/favicons/golem-icon-only-dark.svg",
"src": "/favicons/bench-favicon.png",
"sizes": "any",
"type": "image/svg+xml",
"type": "image/png",
"purpose": "any"
},
{
"src": "/favicons/golem-icon-only-dark.svg",
"src": "/favicons/bench-favicon.png",
"sizes": "any",
"type": "image/svg+xml",
"type": "image/png",
"purpose": "maskable"
}
],
Expand Down
8 changes: 4 additions & 4 deletions docs/src/app/docs/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { notFound } from 'next/navigation'
import { MDXRemote } from 'next-mdx-remote/rsc'
import { Suspense } from 'react'
import remarkGfm from 'remark-gfm'
import Aside from '@/components/Aside'
import BenchmarkSlider from '@/components/BenchmarkSlider'
import BenchmarkViewer from '@/components/BenchmarkViewer'
Expand All @@ -20,10 +24,6 @@ import {
getDocLastModified,
} from '@/lib/mdx'
import { createDocsMetadata, getDocsPageJsonLd } from '@/lib/seo'
import { MDXRemote } from 'next-mdx-remote/rsc'
import { notFound } from 'next/navigation'
import { Suspense } from 'react'
import remarkGfm from 'remark-gfm'

/** Generate a slug id from heading text (matches extractHeadings logic) */
function slugify(text: string): string {
Expand Down
Binary file added docs/src/app/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions docs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ const fadeIn = {

const benchFileCode = `use std::charting

suite keccakBench {
declare suitekeccakBench performance timeBased sameDataset: true {
description: "Keccak256 benchmark - Rust should win here"
warmup: 100ms
baseline: "go"
mode: "auto"
targetTime: 3000ms

after {
Expand Down Expand Up @@ -102,7 +101,7 @@ suite keccakBench {
}

fixture data {
hex: "68656c6c6f20776f726c64"
hex: "64000000"
}

bench keccak256Bench {
Expand Down Expand Up @@ -368,7 +367,7 @@ export default function Home() {
className="mt-8 flex flex-wrap gap-3"
>
<a
href="/docs/getting-started"
href="/docs/introduction"
className="inline-flex items-center gap-2 px-6 py-3 rounded-xl font-medium text-primary-foreground bg-primary hover:bg-primary-hover transition-all hover:scale-[1.02]"
>
Read the Docs <ArrowRight className="w-4 h-4" />
Expand Down Expand Up @@ -895,7 +894,7 @@ export default function Home() {
View on GitHub <ArrowRight className="w-4 h-4" />
</a>
<a
href="/docs/getting-started"
href="/docs/introduction"
className="inline-flex items-center gap-2 px-6 py-3 rounded-xl font-medium text-foreground-secondary !border !border-border bg-secondary/50 hover:bg-secondary transition-colors"
>
Read the Docs
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/robots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { MetadataRoute } from 'next'
import { siteConfig } from '@/lib/seo'

/**
* Generates robots.txt for the viem-go documentation site.
* Generates robots.txt for the poly-bench documentation site.
* This controls how search engine crawlers access and index the site.
*
* @see https://nextjs.org/docs/app/api-reference/file-conventions/metadata/robots
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getAllDocSlugs, getDocLastModified } from '@/lib/mdx'
import { siteConfig } from '@/lib/seo'

/**
* Generates a dynamic sitemap for the viem-go documentation site.
* Generates a dynamic sitemap for the poly-bench documentation site.
* This helps search engines discover and index all pages.
*
* @see https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/CodePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client'

import { useCodeTheme } from '@/lib/use-code-theme'
import { Highlight } from 'prism-react-renderer'
import * as React from 'react'
import { useCodeTheme } from '@/lib/use-code-theme'
import '../lib/prism-bash'
import '../lib/prism-bench'

Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default function Header() {
<VersionDropdown />

<Link
href="/docs/getting-started"
href="/docs/introduction"
className="hidden lg:inline-flex text-sm font-medium px-4 py-2 rounded-lg bg-primary text-primary-foreground transition-colors hover:bg-primary-hover"
>
Read the Docs
Expand Down
15 changes: 15 additions & 0 deletions docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ For custom install paths, unreleased commits, and security notes, see [Installat

## Quick Start

### Install the poly-bench VS Code extension (recommended)

<Aside type="tip">
<span><strong>Use VS Code.</strong> We recommend VS Code over Cursor for poly-bench development — the extension is not yet available on the Cursor marketplace.</span>
</Aside>

You can find the extension on the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=evm-tooling.polybench-lsp). It provides, out of the box:

- Full syntax highlighting
- LSP support
- Hover documentation
- Code completion
- Linting
- Formatting

### 1. Define your bench suite

Initialise a new Polybench project by running the `init` CLI command. you can do so by copying the command below into your terminal
Expand Down
6 changes: 5 additions & 1 deletion docs/src/content/docs/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ With poly-bench, you write one `.bench` file:
}

fixture data {
hex: "68656c6c6f20776f726c64"
hex: "64000000"
}

bench keccak256 {
Expand All @@ -133,6 +133,10 @@ Run `poly-bench run` and get unified results across all three languages with aut
<span>The DSL compiles to native benchmark code in each language. Go benchmarks use Go's testing package, TypeScript runs in Node.js, and Rust uses Cargo's bench infrastructure.</span>
</Aside>

<Aside type="tip">
<span>To get started quickly, check out the [quick start guide](/docs/getting-started).</span>
</Aside>

### Design Principles

poly-bench was built with these principles in mind:
Expand Down
63 changes: 31 additions & 32 deletions docs/src/lib/seo.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
import type { Metadata } from 'next'

/**
* Site-wide SEO configuration for viem-go documentation
* Site-wide SEO configuration for poly-bench documentation
*/

export const siteConfig = {
name: 'viem-go',
title: 'viem-go · Go Interface for Ethereum',
name: 'poly-bench',
title: 'poly-bench · Write Once, Benchmark Everywhere',
description:
'Build reliable blockchain apps & libraries with idiomatic Go, type-safe and composable modules that interface with Ethereum — inspired by viem',
url: 'https://www.viemgolem.sh',
ogImage: '/og-image.png', // Default OG image
creator: '@viemgo', // Update to your Twitter handle
'A cross-language benchmarking framework. Write benchmarks once in a clean DSL and run them natively across Go, TypeScript, Rust, and more.',
url: 'https://poly-bench.rs',
ogImage: '/og-image.png',
creator: '@polybench',
keywords: [
'benchmarking',
'cross-language benchmarking',
'poly-bench',
'Rust',
'Go',
'Golem',
'viem-go',
'Golang',
'Ethereum',
'blockchain',
'viem',
'web3',
'smart contracts',
'TypeScript',
'performance',
'DSL',
'benchmark DSL',
'multi-language',
'developer tools',
'CLI',
'EVM',
'cryptocurrency',
'decentralized',
'RPC',
'JSON-RPC',
'Ethereum client',
'Go Ethereum library',
'type-safe',
'composable',
'performance testing',
'code benchmarks',
'statistical analysis',
'native performance',
] as string[],
authors: [
{
name: 'viem-go',
url: 'https://www.viemgolem.sh',
name: 'poly-bench',
url: 'https://poly-bench.rs',
},
] as Array<{ name: string; url: string }>,
links: {
github: 'https://github.com/evm-tooling/viem-go', // Update to your repo
github: 'https://github.com/evm-tooling/poly-bench',
},
}

Expand Down Expand Up @@ -75,7 +74,7 @@ export function createBaseMetadata(): Metadata {
url: siteConfig.ogImage,
width: 1200,
height: 630,
alt: `${siteConfig.name} - Go Interface for Ethereum`,
alt: `${siteConfig.name} - Write Once, Benchmark Everywhere`,
},
],
},
Expand All @@ -102,15 +101,15 @@ export function createBaseMetadata(): Metadata {
icons: {
icon: [
{
url: '/favicons/golem-icon-only-light.svg',
url: '/favicons/bench-favicon.png',
media: '(prefers-color-scheme: light)',
},
{
url: '/favicons/golem-icon-only-dark.svg',
url: '/favicons/bench-favicon.png',
media: '(prefers-color-scheme: dark)',
},
],
apple: '/favicons/golem-icon-only-dark.svg',
apple: '/favicons/bench-favicon.png',
},
manifest: '/manifest.json',
alternates: {
Expand Down Expand Up @@ -189,7 +188,7 @@ export function getHomePageJsonLd() {
price: '0',
priceCurrency: 'USD',
},
programmingLanguage: 'Go',
programmingLanguage: 'Rust',
}
}

Expand Down Expand Up @@ -230,7 +229,7 @@ export function getDocsPageJsonLd({
isAccessibleForFree: true,
about: {
'@type': 'ComputerLanguage',
name: 'Go',
name: 'Rust',
},
}
}
Expand Down
12 changes: 5 additions & 7 deletions examples/demo-basic/benchmarks/advanced.bench
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ declare suite example performance timeBased sameDataset: false {
'function approve(address spender, uint256 amount) returns (bool)',
'function transferFrom(address from, address to, uint256 amount) returns (bool)',
])

}

helpers {
Expand Down Expand Up @@ -173,13 +172,12 @@ declare suite example performance timeBased sameDataset: false {
}
}


bench concurrent_execution_example {
description: "Fixed execution example"
go: sha256SumGo(data)
ts: sha256SumTs(data)
}

bench outlier_detection_example {
description: "Benchmark with outlier detection enabled"
targetTime: 2000ms
Expand Down Expand Up @@ -209,14 +207,14 @@ declare suite example performance timeBased sameDataset: false {
warmup: 100
before ts: resetCounter()
before go: resetCounter()
after ts: {
void setupCounter
}
after go: {
_ = setupCounter
}
each go: incrementCounter()
after ts: {
void setupCounter
}
each ts: incrementCounter()
each go: incrementCounter()
go: sha256SumGo(data)
ts: sha256SumTs(data)
}
Expand Down
Binary file added extensions/vscode/icons/bench-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions extensions/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "polybench-lsp",
"displayName": "Poly Bench",
"description": "Language support for .bench files with embedded Go, TypeScript, Rust, Python, and C# - powered by poly-bench LSP",
"version": "0.2.3",
"version": "0.2.4",
"publisher": "evm-tooling",
"repository": {
"type": "git",
Expand Down Expand Up @@ -92,7 +92,11 @@
"extensions": [
".bench"
],
"configuration": "./language-configuration.json"
"configuration": "./language-configuration.json",
"icon": {
"light": "./icons/bench-file.png",
"dark": "./icons/bench-file.png"
}
}
],
"grammars": [
Expand Down
Loading
Loading