Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inventory/register refactoring #547

Conversation

newsiberian
Copy link
Contributor

Hello,

I was trying to find a way to make this method faster and reading of this great article gives me a solution. I did some tests with previous version of method with adding childVariant with 1000 items. For me average time of this operations was around 24 seconds. With batchInsert the same operation was taken around 0.1 seconds which is very cool)

`inventory/register` refactored with implementing `batchInsert` method;
added `inventory/register` one more test;
@aaronjudd aaronjudd added the ready label Dec 5, 2015
@aaronjudd
Copy link
Contributor

Good change. I thought about using collection.rawCollection().initializeUnorderedBulkOp(); - another way we could do bulk updates. I think that's what batch-insert is doing right? cool.

aaronjudd pushed a commit that referenced this pull request Dec 5, 2015
@aaronjudd aaronjudd merged commit d0e33af into reactioncommerce:development Dec 5, 2015
@aaronjudd aaronjudd removed the ready label Dec 5, 2015
@newsiberian
Copy link
Contributor Author

answer from the developer if you are interested)

@aaronjudd
Copy link
Contributor

interesting. @tdecaluwe We might want to add a method to ReactionImport and use that in the future -> I see inventory records as something that is likely to be imported a lot.

@newsiberian newsiberian deleted the inventory_register_refactoring branch December 5, 2015 17:33
@tdecaluwe
Copy link
Contributor

I added some details to the docs in PR #555 about why I didn't add support for batch inserts. However batch inserts can still be accomplished through the use of ReactionImport.fixture() (also see PR, section "Batch inserts and fixture data").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants