November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
GetItems is the correct way to do. As a rule of thumb, batching is the fastest way possible
I'm not seeing how you load the variants
Generally speaking - if you think some code is slow, the next step is to profile it to find the bottleneck, then optimize. you are going right direction with GetItems so continue on that path ...
Thanks!
Well, this GetItems call usually takes pretty long.
But will consider what you said.
For variants I then use
product.GetVariants()
// or
var variantLink = _referenceConverter.GetContentLink(variantCode);
_contentLoader.TryGet(variantLink, out variant);
I did not find any way to optimize that call because I have some logic before getting the variants.
How many variants do you have for each product? If you have multiple, it could be faster to use IRelationRepository to get all variant links and get them in one go - again, with GetItems
How many items do you get in one go? I would suggest to start with 20 and optimize further. it sounds like you might get a big batch in one go and the db is the bottleneck. anyway, we can only rely on profiling results (I like dottrace) to make optimizations
Hello,
Currently, the project that I am working on is on .NET 4.8 and Commerce 13.35. I would like to get many products (if possible, without batching/paging).
I am using the following code:
I find the performance a bit slow (with getting the variants for each product it can go up to 10s).
Is there a better/faster way to get a large number of products loaded in one go?