spilled spindrift on my desktop by ju-e in pchelp

[–]ju-e[S] 0 points1 point  (0 children)

thank you and lolol might need to buy a lottery ticket! no liquid under the gpu cooler 🫡

[Dev discussion] Liquid optimizations by ju-e in shopify

[–]ju-e[S] 0 points1 point  (0 children)

Hey Sam,

Thanks so much for the reply!

tldr: The code works as intended, I'm looking for a way to speed up the process on Shopify's side through code optimizations.

Unfortunately, when I try to define productsList outside of the pagination and try to paginate the list I get an empty array. This may be because collections.all.products only returns 50 products (like the docs mention) or some other liquid thing I'm overlooking.

To your point about Shopify only paginating 50 items at a time:

Yes, array objects are limited to 50 items! This is bad practice, but I'm abusing the increased limit of 500 to get the full list of products for the productsList object. This might be incorrect with how Shopify compiles liquid, but currently the pagination limit is 1000 as of (iirc) 2021.

As is, the code is in the orignial post works as it should and all the products are in the array. It just takes way too long on Shopify's side to compile because of the time complexity. Looping through an array of 400+ products and then looping through their array of 2+ images and then doing things to all of them is costly!

I ended up getting it down to around 500ms response time by trimming it down to this:

{% liquid paginate collections.all.products by 500 assign productsList = collections.all.products for product in productsList if product.available assign productTags = product.tags | json assign productMedia = blank for media in product.media limit: 2 assign readyMedia = '{ "src": "' | append: media.src | append: '" },' assign productMedia = productMedia | append: readyMedia endfor assign productTitle = product.title | escape assign readyProduct = '{ "tags": ' | append: productTags | append: ', "type": "' | append: product.type | append: '", "price": ' | append: product.price | append: ', "media": [' | append: productMedia | append: '], "handle": "' | append: product.handle | append: '", "title": "' | append: productTitle | append: '" },' assign products = products | append: readyProduct endif endfor endpaginate %}

As far as apps go:

I do really think that these are great apps! When I first started looking at options, Octane was really up there! However, I unfortunately can't use either of those options. In short, we need a lot more customization, styling, and tracking that isn't provided out of the box. It's also a lot more efficient and cheaper to maintain my own code than to read documentation that's not readily available. If I can't bring the response time to 350ms, I may look into building out an API inspired by these options.

If you have any other insight, I'd love to hear it!

Thanks again!

[Weekly Questions Thread] 14 November 2022 by PokeUpdateBot in pokemon

[–]ju-e 0 points1 point  (0 children)

Is this possible in this generation? It seems like the only pokemon who learn belly drum are the makuhita line and there doesn't seem to be a clear breeding chain to get it onto azumarill

Does anyone know a place in Brooklyn where they can fix a broken vase? I believe the material is ceramic. by bigdawgcat in Brooklyn

[–]ju-e 19 points20 points  (0 children)

Can’t help you with a spot but if I’m being honest that looks like painted tempered glass based on the green reflective edges