I notice that in admin interface the order loading is called very often.
So i patched it to use static loading, as in node_load.

Here is the patch.

CommentFileSizeAuthor
#5 uc_order.1148038.5.patch745 byteseliosh
#1 uc_order.1148038_1.patch659 byteseliosh

Comments

eliosh’s picture

StatusFileSize
new659 bytes

Ops. Here is the file.

Status: Needs review » Needs work

The last submitted patch, uc_order.1148038_1.patch, failed testing.

longwave’s picture

Can you give some examples where this is actually a performance problem?

Also, there needs to be some way of resetting the static cache; what if an order is loaded, updated, saved, and reloaded within the same page request?

tr’s picture

Version: 6.x-2.4 » 6.x-2.x-dev

Patch should be made relative to the ubercart directory rather than the uc_order directory, and should be rolled against the -dev release if possible. Changing version.

eliosh’s picture

Status: Needs work » Needs review
StatusFileSize
new745 bytes

@longwave: i reduced query from >500 to ~250 (i don't have real number now) for admin order page.

@TR: patched against -dev version with suggestions from you and from @longwave for static resetting.

longwave’s picture

Unsure whether this will affect existing contrib modules that may update an order somehow then expect uc_order_load() to load the updated object later in the same page request, without knowledge of the static cache.

If you can identify where on the admin page order objects are being loaded twice, perhaps that would be a better fix? Presumably you mean /admin/store/orders?

eliosh’s picture

Yes, it's on "admin/store/orders/" page.

I'll try to investigate it deeper and try to understand who loads this order multiple times...

longwave’s picture

Status: Needs review » Closed (won't fix)

I still don't see how we can do this without affecting contrib through possible stale caches, and I can't see this as a real performance issue either. Please reopen with more info if this is still needed.