Performance improvements to OrderRefresh

Created on 25 June 2025, 12 days ago

Describe your bug or feature request.

Currently, the OrderRefresh service calls $order_item->hasTranslationChanges() for each order item, to detect whether the order item needs to be saved.

The problem is this calls OrderItemStorage::loadUnchanged() reloading each order item from the DB (sometimes from the static cache, but somehow seems to load from the DB according to several requests I've been profiling with Blackfire).

I'm thinking we could store the original order items in an array, then artificially set $order_item->original right before calling the hasTranslationChanges(). This should prevent the need from reloading each order item from DB...

MR to follow (I'm hoping this won't break anything)...

📌 Task
Status

Active

Version

3.0

Component

Order

Created by

🇮🇱Israel jsacksick

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024