-
Notifications
You must be signed in to change notification settings - Fork 33
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
Optimize the category PK search #104
Comments
@martonmiklos Where is the gain in your experience and by how much? Adding conditions based on API version is going to be tough to maintain... it would be preferable to request the InvenTree Python API to catch up and up the Ki-nTree dependency. What do you think? |
Increasing the min API version in the python API would mean that the python API would drop support for older InvenTree versions which I think until a point when it is not necessary should be avoidable. I do not know how wide is the Ki-n-tree user base, but the best possible option would be setting an API barrier here, and throw error if lower API version of InvenTree is connected. |
The thing is, I'm not really sure where the gain is... I don't have any performance issue using Ki-nTree. |
Just to take some numbers to the desk I put together the following script: It gives me the following run time (with 1618 categories):
I have not traced the Kin-Tree yet how often does this category filter function get called, but at some point I would like to add mass import feature from CSV to it where the 30 vs. 300 ms ish time could count something. My recommendation would be to keep this in mind and at some point (maybe when the InvenTree python API sets the min. level above the necessary) we can drop the current code. |
Ok that's a nice improvement and yes I agree with the strategy of waiting till older versions of InvenTree become really old to assume we can make the change. It is related to the implementation you did in #87 right? |
Well I have been worked on an Arena PLM migration tool where implementing it became necessary to implement it in InvenTree. |
Thanks @martonmiklos. Currently on InvenTree's I would guess that for the imminent Sounds reasonable? |
Hey,
I have recently added the name field of the Categories to the filterable columns in InvenTree:
inventree/InvenTree#3854
This would allow to make this code to be made more efficient:
Ki-nTree/kintree/database/inventree_api.py
Line 48 in 84be9dd
with simplifying to:
This change got introduced with the InvenTree API version 78, the inventree-python depends on the version 51:
https://github.com/inventree/inventree-python/blob/master/inventree/api.py#L25
It might be possible to add a condition based on the server's API version?
The text was updated successfully, but these errors were encountered: