@@ -9,6 +9,8 @@ const [, , resultsDir = '.'] = process.argv;
99const backendConfig = {
1010 local : { emoji : '💻' , label : 'Local' } ,
1111 postgres : { emoji : '🐘' , label : 'Postgres' } ,
12+ 'postgres-pgboss' : { emoji : '🐘' , label : 'Postgres (pg-boss)' } ,
13+ 'postgres-graphile' : { emoji : '🐘' , label : 'Postgres (graphile)' } ,
1214 vercel : { emoji : '▲' , label : 'Vercel' } ,
1315} ;
1416
@@ -49,9 +51,35 @@ function findBenchmarkFiles(dir) {
4951// Parse filename to extract app and backend
5052function parseFilename ( filename ) {
5153 // Format: bench-results-{app}-{backend}.json
52- const match = filename . match ( / b e n c h - r e s u l t s - ( .+ ) - ( \w + ) \. j s o n $ / ) ;
53- if ( ! match ) return null ;
54- return { app : match [ 1 ] , backend : match [ 2 ] } ;
54+ // Backend can be: local, postgres, postgres-pgboss, postgres-graphile, vercel
55+ const knownBackends = [
56+ 'postgres-pgboss' ,
57+ 'postgres-graphile' ,
58+ 'postgres' ,
59+ 'local' ,
60+ 'vercel' ,
61+ ] ;
62+
63+ const baseName = filename
64+ . replace ( / \. j s o n $ / , '' )
65+ . replace ( / ^ b e n c h - r e s u l t s - / , '' ) ;
66+ if ( ! baseName ) return null ;
67+
68+ // Try each known backend (longest first to match postgres-pgboss before postgres)
69+ for ( const backend of knownBackends ) {
70+ if ( baseName . endsWith ( `-${ backend } ` ) ) {
71+ const app = baseName . slice ( 0 , - ( backend . length + 1 ) ) ;
72+ return { app, backend } ;
73+ }
74+ }
75+
76+ // Fallback: last segment after hyphen
77+ const lastHyphen = baseName . lastIndexOf ( '-' ) ;
78+ if ( lastHyphen === - 1 ) return null ;
79+ return {
80+ app : baseName . slice ( 0 , lastHyphen ) ,
81+ backend : baseName . slice ( lastHyphen + 1 ) ,
82+ } ;
5583}
5684
5785// Load timing data for a benchmark file
@@ -147,11 +175,20 @@ function getAppsAndBackends(data) {
147175 }
148176 }
149177
150- // Sort: local, postgres, vercel for backends
151- const backendOrder = [ 'local' , 'postgres' , 'vercel' ] ;
152- const sortedBackends = [ ...backends ] . sort (
153- ( a , b ) => backendOrder . indexOf ( a ) - backendOrder . indexOf ( b )
154- ) ;
178+ // Sort: local, postgres variants, vercel for backends
179+ const backendOrder = [
180+ 'local' ,
181+ 'postgres' ,
182+ 'postgres-pgboss' ,
183+ 'postgres-graphile' ,
184+ 'vercel' ,
185+ ] ;
186+ const sortedBackends = [ ...backends ] . sort ( ( a , b ) => {
187+ const aIdx = backendOrder . indexOf ( a ) ;
188+ const bIdx = backendOrder . indexOf ( b ) ;
189+ // Unknown backends go to the end
190+ return ( aIdx === - 1 ? 999 : aIdx ) - ( bIdx === - 1 ? 999 : bIdx ) ;
191+ } ) ;
155192
156193 // Sort apps alphabetically
157194 const sortedApps = [ ...apps ] . sort ( ) ;
@@ -348,7 +385,10 @@ function renderComparison(data) {
348385 console . log ( '' ) ;
349386 console . log ( '**Backends:**' ) ;
350387 console . log ( '- 💻 Local: In-memory filesystem backend' ) ;
351- console . log ( '- 🐘 Postgres: PostgreSQL database backend' ) ;
388+ console . log ( '- 🐘 Postgres (pg-boss): PostgreSQL with pg-boss queue driver' ) ;
389+ console . log (
390+ '- 🐘 Postgres (graphile): PostgreSQL with Graphile Worker queue driver'
391+ ) ;
352392 console . log ( '- ▲ Vercel: Vercel production backend' ) ;
353393 console . log ( '</details>' ) ;
354394}
0 commit comments