A benchmarking tool for comparing performance across multiple browser automation providers (Browserbase, Hyperbrowser, Browserless, and Anchorbrowser).
This tool dynamically loads provider configurations and runs performance benchmarks to measure:
- Connection Time: Time to connect to the browser WebSocket endpoint
- Page Creation: Time to create a new browser page
- Navigation: Time to navigate to a target URL
-
Clone the repository (if not already done):
git clone <repository-url> cd browserbase
-
Install dependencies:
npm install
-
Configure environment variables:
cp .env.example .env
Then edit
.envwith your actual API keys and configuration.
Create a .env file in the project root with the following variables:
# Number of benchmark iterations to run
TOTAL=10
# Target URL to navigate to during benchmarks
URL=https://www.example.com/Hyperbrowser
HYPERBROWSER_API_KEY=your_hyperbrowser_api_key_hereBrowserless
BROWSERLESS_API_KEY=your_browserless_api_key_hereAnchorbrowser
ANCHORBROWSER_API_KEY=your_anchorbrowser_api_key_hereBrowserbase
BROWSERBASE_API_KEY=your_browserbase_api_key_here
BROWSERBASE_PROJECT_ID=your_browserbase_project_id_hereNote: You only need to configure API keys for the providers you want to benchmark. Providers without valid credentials will be skipped automatically.
Run the benchmark suite:
node index.jsThe tool will:
- Automatically discover all provider modules in the
providers/directory - Load and validate each provider
- Run benchmarks sequentially for each configured provider
- Display performance metrics in a formatted table
🔍 Loading providers...
✓ Loaded provider: browserbase
✓ Loaded provider: hyperbrowser
✓ Loaded provider: browserless
✓ Loaded provider: anchorbrowser
📊 Found 4 provider(s)
==================================================
[1/4] Running benchmark for: browserbase
==================================================
=== Test Configuration ===
Provider: Browserbase
Browser Version: Chrome/120.0.6099.109
Total Executions : 10
URL: "https://www.example.com/"
==========================
┌─────────────────┬────────────┬─────────┬─────────┐
│ Metrics │ Average │ Fastest │ Slowest │
├─────────────────┼────────────┼─────────┼─────────┤
│ Connection │ 1234.5 │ 1100 │ 1450 │
│ Page Creation │ 234.2 │ 200 │ 280 │
│ Navigation │ 567.8 │ 520 │ 620 │
└─────────────────┴────────────┴─────────┴─────────┘
.
├── index.js # Main entry point, dynamic provider loader
├── runner.js # Benchmark execution logic
├── providers/ # Provider-specific implementations
│ ├── browserbase.js
│ ├── hyperbrowser.js
│ ├── browserless.js
│ └── anchorbrowser.js
├── .env # Your local configuration (not committed)
├── .env.example # Template for environment variables
└── package.json # Project dependencies
To add a new provider:
- Create a new file in
providers/(e.g.,providers/newprovider.js) - Export
setupand optionallyteardownfunctions:
export const setup = async () => {
// Initialize your provider and return:
return {
browserWSEndpoint: 'ws://your-endpoint',
provider: 'Your Provider Name'
};
};
export const teardown = async (setupResult) => {
// Optional cleanup
};- Add any required environment variables to
.env - The provider will be automatically discovered and loaded on next run
@browserbasehq/sdk- Browserbase SDK@hyperbrowser/sdk- Hyperbrowser SDKpuppeteer-core- Puppeteer without bundled Chromiumdotenv- Environment variable management
See LICENSE file for details.