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
31 changes: 25 additions & 6 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@computesdk/s3": "^1.1.1",
"@computesdk/sprites": "^0.1.5",
"@computesdk/tigris": "^1.1.1",
"@computesdk/vercel": "^1.7.21",
"@computesdk/vercel": "1.7.15",
"computesdk": "^2.5.4",
"dotenv": "^17.4.0",
"playwright-core": "^1.59.1"
Expand Down
18 changes: 0 additions & 18 deletions src/browser/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,24 +135,6 @@ export async function runBrowserBenchmark(config: BrowserProviderConfig): Promis

const successful = results.filter(r => !r.error);

// If every iteration failed, mark as skipped
if (successful.length === 0) {
return {
provider: name,
mode: 'browser',
iterations: results,
summary: {
createMs: { median: 0, p95: 0, p99: 0 },
connectMs: { median: 0, p95: 0, p99: 0 },
navigateMs: { median: 0, p95: 0, p99: 0 },
releaseMs: { median: 0, p95: 0, p99: 0 },
totalMs: { median: 0, p95: 0, p99: 0 },
},
skipped: true,
skipReason: 'All iterations failed',
};
}

return {
provider: name,
mode: 'browser',
Expand Down
8 changes: 0 additions & 8 deletions src/merge-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,6 @@ function printStorageResultsTable(results: StorageBenchmarkResult[], fileSize: s
}
const ok = r.iterations.filter(i => !i.error).length;
const total = r.iterations.length;
if (ok === 0 && total > 0) {
console.log([r.provider.padEnd(14), '--'.padEnd(8), '--'.padEnd(14), '--'.padEnd(14), '--'.padEnd(14), 'FAILED'.padEnd(10)].join(' | '));
continue;
}
const score = r.compositeScore !== undefined ? r.compositeScore.toFixed(1) : '--';
const dl = (r.summary.downloadMs.median / 1000).toFixed(2) + 's';
const tp = r.summary.throughputMbps.median.toFixed(1) + ' Mbps';
Expand Down Expand Up @@ -300,10 +296,6 @@ function printBrowserResultsTable(results: BrowserBenchmarkResult[]): void {
}
const ok = r.iterations.filter(i => !i.error).length;
const total = r.iterations.length;
if (ok === 0 && total > 0) {
console.log([r.provider.padEnd(14), '--'.padEnd(8), '--'.padEnd(12), '--'.padEnd(12), '--'.padEnd(12), '--'.padEnd(12), '--'.padEnd(12), 'FAILED'.padEnd(10)].join(' | '));
continue;
}
const score = r.compositeScore !== undefined ? r.compositeScore.toFixed(1) : '--';
const create = (r.summary.createMs.median / 1000).toFixed(2) + 's';
const connect = (r.summary.connectMs.median / 1000).toFixed(2) + 's';
Expand Down
8 changes: 6 additions & 2 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ async function runStorage(toRun: typeof storageProviders, fileSizeLabel: string)
console.log(`${r.provider}: SKIPPED (${r.skipReason})`);
continue;
}
const ok = r.iterations.filter(i => !i.error).length;
const total = r.iterations.length;
console.log(`${r.provider}:`);
console.log(` Download: ${(r.summary.downloadMs.median / 1000).toFixed(2)}s (median), ${r.summary.throughputMbps.median.toFixed(2)} Mbps`);
console.log(` Score: ${r.compositeScore?.toFixed(1) || '--'}`);
console.log(` Score: ${r.compositeScore?.toFixed(1) || '--'} (${ok}/${total} OK)`);
}

// Write JSON results to storage subdirectory with file size
Expand Down Expand Up @@ -193,9 +195,11 @@ async function runBrowser(toRun: typeof browserProviders): Promise<void> {
console.log(`${r.provider}: SKIPPED (${r.skipReason})`);
continue;
}
const ok = r.iterations.filter(i => !i.error).length;
const total = r.iterations.length;
console.log(`${r.provider}:`);
console.log(` Total: ${(r.summary.totalMs.median / 1000).toFixed(2)}s (median) — create ${(r.summary.createMs.median / 1000).toFixed(2)}s + connect ${(r.summary.connectMs.median / 1000).toFixed(2)}s + navigate ${(r.summary.navigateMs.median / 1000).toFixed(2)}s + release ${(r.summary.releaseMs.median / 1000).toFixed(2)}s`);
console.log(` Score: ${r.compositeScore?.toFixed(1) || '--'}`);
console.log(` Score: ${r.compositeScore?.toFixed(1) || '--'} (${ok}/${total} OK)`);
}

// Write JSON results to browser subdirectory
Expand Down
15 changes: 3 additions & 12 deletions src/sandbox/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,13 @@ export async function runBenchmark(config: ProviderConfig): Promise<BenchmarkRes

const successful = results.filter(r => !r.error);

// If every iteration failed, mark as skipped so it doesn't show 0.00s
if (successful.length === 0) {
return {
provider: name,
iterations: results,
summary: { ttiMs: { median: 0, p95: 0, p99: 0 } },
skipped: true,
skipReason: 'All iterations failed',
};
}

return {
provider: name,
iterations: results,
summary: {
ttiMs: computeStats(successful.map(r => r.ttiMs)),
ttiMs: successful.length > 0
? computeStats(successful.map(r => r.ttiMs))
: { median: 0, p95: 0, p99: 0 },
},
};
}
Expand Down
20 changes: 4 additions & 16 deletions src/sandbox/concurrent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,8 @@ export async function runConcurrentBenchmark(config: ConcurrentConfig): Promise<

const successful = results.filter(r => !r.error);

if (successful.length === 0) {
return {
provider: name,
mode: 'concurrent',
concurrency,
iterations: results,
summary: { ttiMs: { median: 0, p95: 0, p99: 0 } },
wallClockMs,
timeToFirstReadyMs: 0,
skipped: true,
skipReason: 'All sandboxes failed',
};
}

const successfulTimes = successful.map(r => r.ttiMs);
const timeToFirstReadyMs = Math.min(...successfulTimes);
const timeToFirstReadyMs = successful.length > 0 ? Math.min(...successfulTimes) : 0;

console.log(` Wall clock: ${(wallClockMs / 1000).toFixed(2)}s | First ready: ${(timeToFirstReadyMs / 1000).toFixed(2)}s | Success: ${successful.length}/${concurrency}`);

Expand All @@ -75,7 +61,9 @@ export async function runConcurrentBenchmark(config: ConcurrentConfig): Promise<
concurrency,
iterations: results,
summary: {
ttiMs: computeStats(successfulTimes),
ttiMs: successful.length > 0
? computeStats(successfulTimes)
: { median: 0, p95: 0, p99: 0 },
},
wallClockMs,
timeToFirstReadyMs,
Expand Down
22 changes: 4 additions & 18 deletions src/sandbox/staggered.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,8 @@ export async function runStaggeredBenchmark(config: StaggeredConfig): Promise<St

const successful = results.filter(r => !r.error);

if (successful.length === 0) {
return {
provider: name,
mode: 'staggered',
concurrency,
staggerDelayMs,
iterations: results,
summary: { ttiMs: { median: 0, p95: 0, p99: 0 } },
wallClockMs,
timeToFirstReadyMs: 0,
rampProfile: rampProfile.sort((a, b) => a.launchedAt - b.launchedAt),
skipped: true,
skipReason: 'All sandboxes failed',
};
}

const successfulTimes = successful.map(r => r.ttiMs);
const timeToFirstReadyMs = Math.min(...successfulTimes);
const timeToFirstReadyMs = successful.length > 0 ? Math.min(...successfulTimes) : 0;

console.log(` Wall clock: ${(wallClockMs / 1000).toFixed(2)}s | First ready: ${(timeToFirstReadyMs / 1000).toFixed(2)}s | Success: ${successful.length}/${concurrency}`);

Expand All @@ -93,7 +77,9 @@ export async function runStaggeredBenchmark(config: StaggeredConfig): Promise<St
staggerDelayMs,
iterations: results,
summary: {
ttiMs: computeStats(successfulTimes),
ttiMs: successful.length > 0
? computeStats(successfulTimes)
: { median: 0, p95: 0, p99: 0 },
},
wallClockMs,
timeToFirstReadyMs,
Expand Down
16 changes: 0 additions & 16 deletions src/sandbox/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,6 @@ export function printResultsTable(results: BenchmarkResult[]): void {
const successful = result.iterations.filter(r => !r.error).length;
const total = result.iterations.length;

// If all iterations failed, show as FAILED with error reason
if (successful === 0 && total > 0) {
const firstError = result.iterations.find(r => r.error)?.error || 'Unknown error';
const shortError = firstError.length > 40 ? firstError.slice(0, 37) + '...' : firstError;
console.log([
pad(result.provider, nameWidth),
pad('--', 8),
pad('--', colWidth),
pad('--', colWidth),
pad('--', colWidth),
pad(`FAILED`, 10),
].join(' | '));
continue;
}

// Truly skipped (missing env vars, etc.)
if (result.skipped) {
console.log([
pad(result.provider, nameWidth),
Expand Down
18 changes: 0 additions & 18 deletions src/storage/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,6 @@ export async function runStorageBenchmark(config: StorageProviderConfig, fileSiz

const successful = results.filter(r => !r.error);

// If every iteration failed, mark as skipped
if (successful.length === 0) {
return {
provider: name,
mode: 'storage',
bucket,
fileSizeBytes,
iterations: results,
summary: {
uploadMs: { median: 0, p95: 0, p99: 0 },
downloadMs: { median: 0, p95: 0, p99: 0 },
throughputMbps: { median: 0, p95: 0, p99: 0 },
},
skipped: true,
skipReason: 'All iterations failed',
};
}

const uploadTimes = successful.map(r => r.uploadMs);
const downloadTimes = successful.map(r => r.downloadMs);
const throughputs = successful.map(r => r.throughputMbps);
Expand Down
Loading