Skip to content

Performance improvement for partitions with a large number of steps [BATCH-2716] #891

@spring-projects-issues

Description

@spring-projects-issues

Krishna Bhamidipati opened BATCH-2716 and commented

Each time partitions are created, SimpleStepExecutionSplitter#split queries the Spring Batch tables to double check if the partitioned step is a restart. This originally scanned the entire table for each time.

The patched approach uses a new method on JobRepository which allows SimpleStepExecutionSplitter to retreive all the step executions at the time of partitioning. By assuming there are no other threads creating conflicting partitions for the same job instance, the splitting is more efficient.

The performance improvement is easily an order of magnitude better (26x from initial benchmarks, attached) and works well for jobs with > 1000 steps.

Patched source is attached and also available on https://github.com/NaanProphet/spring-batch-large-step-perf-fix


Affects: 3.0.3

Attachments:

Referenced from: pull request #716, and commits 62a8f44

Backported to: 4.2.0.RC1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions