perf: 23% faster job queue system on postgres/sqlite (#13187)
Previously, a single run of the simplest job queue workflow (1 single task, no db calls by user code in the task - we're just testing db system overhead) would result in **22 db roundtrips** on drizzle. This PR reduces it to **17 db roundtrips** by doing the following: - Modifies db.updateJobs to use the new optimized upsertRow function if the update is simple - Do not unnecessarily pass the job log to the final job update when the workflow completes => allows using the optimized upsertRow function, as only the main table is involved --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1210888186878606
This commit is contained in:
19
test/queues/config.postgreslogs.ts
Normal file
19
test/queues/config.postgreslogs.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/* eslint-disable no-restricted-exports */
|
||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
|
||||
import { getConfig } from './getConfig.js'
|
||||
|
||||
const config = getConfig()
|
||||
|
||||
import { postgresAdapter } from '@payloadcms/db-postgres'
|
||||
|
||||
export const databaseAdapter = postgresAdapter({
|
||||
pool: {
|
||||
connectionString: process.env.POSTGRES_URL || 'postgres://127.0.0.1:5432/payloadtests',
|
||||
},
|
||||
logger: true,
|
||||
})
|
||||
|
||||
export default buildConfigWithDefaults({
|
||||
...config,
|
||||
db: databaseAdapter,
|
||||
})
|
||||
Reference in New Issue
Block a user