-
Notifications
You must be signed in to change notification settings - Fork 135
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
Complexity in validate SPDX ID causing slowdown #742
Comments
Thanks for this analysis and identification of the cause. This helps! |
Hey @lumjjb, I just tried replacing the offending list with a set (that additionally only gets computed once instead of every time the function is called), but could not observe any significant speed-up in the validation process. Do you have any other ideas which parts of the code could be sped up? I'll keep you updated if I find anything! :) |
Also, can you share your SBOM that you used? Your relationship validation seems to take a lot of time, which it does not for me. |
Awesome! Let me try this out and let you know! Thanks for diving into that! Sorry i cant share the SBOM :(. Let me do some testing again and report back! |
Hey @lumjjb, how did your testing go? Is there still an issue or can this be closed? |
Yea this is good now! Can close this up! Thanks @armintaenzertng ! |
There is quite a bit of slowdown in the validation routine of the SPDX document, one potentially offender seems to be this function which loads in the entire list of IDs in a document over and over for each call, with a linear search for the ID each time.
tools-python/src/spdx_tools/spdx/validation/spdx_id_validators.py
Lines 25 to 28 in f15a64f
This came up due to slowdown when running ntia-checker
Ask:
Could there be a function that would be able to do this on multiple invocations that uses a dictionary?
The text was updated successfully, but these errors were encountered: