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.