Repository navigation
BOM import / export improvements - #2349
SchrodingersGat wants to merge 12 commits into
Conversation
# Conflicts: # InvenTree/part/api.py
|
Closing for now, this approach is not working... |
|
@SchrodingersGat what was the problem / painpoint? |
|
The current BOM import is incredibly slow, especially when you have a db with lots (> 1000) of parts. The existing import process iterates through every single part, for each imported line item. It takes enough time to timeout our production server at work. There are a few different approaches I've been considering, I want to reduce code duplication as much as possible also. I've been trying to work out how we can use |
|
@SchrodingersGat I meant with the PR 😆 |
|
Ah, I wanted to investigate some other options... |
|
I tried using import-export for something similar a while ago and gave up on it. Anything per-line is problematic. I found it is faster to do this in multiple subsequent steps. So create all parts as a bulk operation, then run all operations that need to run on the new objects. Also optimising the save() overrides and signals helped a lot with my last project. Maybe this is an option for us too. Profiling is def. a must for something like this. |
|
I also found django-data-wizard which might be an option, but it doesn't feel like it's 100% the right solution... I'll keep having a tinker |
|
@SchrodingersGat I am quite full this week but I would love to give it a try next week. Could you add a foo file that reflects the structure that makes the problem you want to be solved? So we can have a baseline to run tests against? |
|
It's probably only the 3rd step (part matching) that needs profiling/speed improvement, right? Even with 1000s of parts in DB the matching should be straightforward with IPN, maybe not so much with name of description though... |
|
@eeintech the third step is the worst offender, true. |
No description provided.