Skip to content

Performance Optimization: Improve bulk_update_with_history efficiency #1563

@pedrohenriquerls

Description

@pedrohenriquerls

When using bulk_update_with_history to update large batches of records, the function performs unnecessary computations for each object in the batch. This creates performance overhead that becomes significant when processing thousands of records.
The main issue is that certain values that should be the same for all objects in a batch (like timestamps, model metadata, or field lists) are being recalculated for every single object, even though they don't change. For objects with around 20 attributes, the execution gets ~20% slower than for simpler objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions