Skip to content

Bug + Feature Request: Correct apply_path_mapping op counting and use trie for performance #210

Description

@mwiebe

Describe the bug

In #207 (comment), we found that the apply_path_mapping function wasn't doing the correct accounting for its operation count.

Expected Behaviour

Instead of changing the account, we can fix the implementation to use a more efficient algorithm.

The code https://github.com/aws-deadline/deadline-cloud-job-attachments/blob/2ae3635c6f5642846e9a98cdf1075f867886133a/src/deadline/job_attachments/_path_mapping.py#L92 uses a trie as an accelerator for applying the path mapping. We should port that trie to this crate, both expose it as a struct that any clients of the crate can use, and make it the basis of the apply_path_mapping function.

Current Behaviour

Currently it iterates through each path mapping rule and attempts to apply it.

Reproduction Steps

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageA new issue that needs a first look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions