Skip to content

Performance impact of PathBasedItem #581

Closed
@mih

Description

@mih

This dataclass is used in pretty much all iterators of iter_collections. In #580 I saw that the conversion of path strings to PurePath instances can represent as much as half of the runtime of such an iterator.

It seems worthwhile to consider optimizations in this regard.

One possibility would be to change PathBasedItem to leave its name property untouched (Any), and add an accessor property (@cached_property) path that performs the conversion lazily. With this approach, any conversion performance cost would only need to be paid when actually necessary. Moreover, consumer would be given the choice of format of an item name.

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