Skip to content

Improve ABOUT file handling in d2d pipeline #1004

Description

@pombredanne
  1. It may take a significant time to map now that we are using patterns.
    Using a query regex and possibly tow conditions with ignores/excludes is likely to be slow. I think we may end up having multiple full table scans in a loop. This main explain why this pipeline step now runs about 5 to 12 times slower than before. I suggest to invert the processing. Right now, we process here this way: https://github.com/nexB/scancode.io/blob/c29c62884a383ae00cb67f5c1e03166e548e4056/scanpipe/pipes/d2d.py#L856C1-L856C1
  • for each ABOUT file
    • for each resource matching ABOUT file paths and excludes
      • .....
    • create/update Package

Instead we could do this, ensuring we ever do a single pass on the resources:

  • for each ABOUT file
    • collect path patterns and translate and compile to regex
  • for each resource:
    • for each ABOUT file pattern
      • if resource matching ABOUT file paths and excludes
        • accumulate Resource for a later bulk operation
      • .....
  • for each mapped ABOUT file:
    • create/update Package
    • bulk create the Package -> Resources relationships
  • for each non-mapped:
    • save warning
  1. Companion files should be taken from the ABOUT file, not implied based on naming conventions this should be using the ABOUT file content https://github.com/nexB/scancode.io/blob/c29c62884a383ae00cb67f5c1e03166e548e4056/scanpipe/pipes/d2d.py#L859

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions