Skip to content

Commit

Permalink
try smaller batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Mar 3, 2024
1 parent 434a06b commit d855bb9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ jobs:

runs-on: ${{ matrix.operating-system }}

services:
postgres:
# Docker Hub image
image: "postgres:16.1"
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: eventstore
options: >-
--health-cmd "pg_isready"
ports:
- "5432:5432"

strategy:
matrix:
dependencies:
Expand All @@ -20,6 +33,9 @@ jobs:
operating-system:
- "ubuntu-latest"

env:
DB_URL: 'pdo-pgsql://postgres:postgres@localhost:5432/eventstore?charset=utf8'

steps:
- name: "Install PHP"
uses: "shivammathur/[email protected]"
Expand Down
2 changes: 2 additions & 0 deletions src/Store/DoctrineDbalStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ function (Connection $connection) use ($messages): void {
$batchSize = (int)floor(self::MAX_UNSIGNED_SMALL_INT / $columnsLength);
$placeholder = implode(', ', array_fill(0, $columnsLength, '?'));

$batchSize = 1000;

$parameters = [];
$placeholders = [];
/** @var array<int<0, max>, Type> $types */
Expand Down

0 comments on commit d855bb9

Please sign in to comment.