woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.31k stars 10.75k forks source link

CYS: Improve loading time #50586

Open gigitux opened 1 month ago

gigitux commented 1 month ago

Our analysis revealed that a significant number of users drop off during the assembler hub's loading phase, highlighting an opportunity to improve user retention by optimizing load times.

tjcafferkey commented 3 weeks ago

Highlighting a comment that came up during a conversation with @gigitux regarding this.

IMHO, the pain point is the creation of the products for the loading times

tjcafferkey commented 3 weeks ago

Note: Check if store has products before creating them.

gigitux commented 3 weeks ago

I recommend addressing #50586 #50834 and #50873 before starting on this one.

At present, fonts are installed during setup since they aren’t included with TT4. However, the Assembler theme includes all necessary fonts, which should enhance loading times, though it’s hard to quantify the exact improvement.

Aljullu commented 2 weeks ago

I recommend addressing https://github.com/woocommerce/woocommerce/issues/50586 and https://github.com/woocommerce/woocommerce/issues/50873 before starting on this one.

@gigitux did you mean #50834 instead of #50586?

gigitux commented 2 weeks ago

I recommend addressing #50586 and #50873 before starting on this one.

@gigitux did you mean #50834 instead of #50586?

Yes! I updated the comment!

Aljullu commented 2 weeks ago

Note: Check if store has products before creating them.

If I'm understanding the code right, this is already done in this line: :slightly_smiling_face:

https://github.com/woocommerce/woocommerce/blob/b4322595c587edae333672717e10f17f95367ef9/plugins/woocommerce/src/Blocks/AIContent/UpdateProducts.php#L105

One related thing that we discussed during the call was to move the Add products task before the Customize your store task. That would mean that, in most cases, stores would already have products when they get started with Customize your store. I think this is also what Shopify is doing but it would require some design/product feedback. cc @verofasulo

Onboarding screenshot

tjcafferkey commented 1 week ago

I conducted a basic analysis of our loading times and discovered that the product creation process is taking up the majority of the time. Here's what I found:

It's important to note that I haven't yet determined which specific part of the product creation process is the most time-consuming. There are several steps involved, such as creating the product itself and uploading product images.

According to @gigitux, he suspects that the image upload portion of the process is likely the biggest time sink. This is a reasonable assumption.

To address this issue, I'm considering exploring an alternative approach. One potential solution could be to leverage WooCommerce's native CSV upload functionality. This feature is designed for bulk product creation and is likely already optimized for efficiency.

tjcafferkey commented 1 week ago

I've also noticed we are using pattern placeholder images for our dummy product images. Even though these were recently optimized (https://github.com/woocommerce/woocommerce/pull/50405) for patterns I'm not sure they are entirely appropriate for product images since some of them are 2500px in width.

We can probably optimize the product images further by creating product specific versions of these placeholders, reducing filesize even further.

tjcafferkey commented 1 week ago

Another consideration to think about would be the possibility to enabling a way to use external images as product images (e.g. inputting a image URL) for sample products (_headstart_post) this would potentially speed up the loading times as a lot of time is being spent during the image upload part of the product creation process.

We could then schedule an action scheduler to properly fetch and upload the images in the background. Although we would need to ensure:

There is always the scenario where the scheduled action fails, however given these are only sample products would we consider this a problem if they're still being shown in both the above places?

For context I performed a basic test around creating products with/without images and found:

richtabor commented 4 days ago

What's the current average load time?

Aljullu commented 4 days ago

What's the current average load time?

AFAIK we aren't tracking this yet, but adding loading times tracking is in the roadmap (https://github.com/woocommerce/woocommerce/issues/50832).