Skip to content
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

Speedup audb.Dependencies to list conversions #362

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Feb 6, 2024

Speeds up conversion to Python list by using x.tolist() instead of list(x) in the following methods/properties:

  • audb.Dependencies.__getitem__()
  • audb.Dependencies.attachments
  • audb.Dependencies.attachment_ids
  • audb.Dependencies.files
  • audb.Dependencies.media
  • audb.Dependencies.removed_media
  • audb.Dependencies.tables
Method main this branch
Dependency.__call__() 0.000 s 0.000 s
Dependency.__contains__() 0.000 s 0.000 s
Dependency.__get_item__() 0.000 s 0.000 s
Dependency.__len__() 0.000 s 0.000 s
Dependency.__str__() 0.006 s 0.006 s
Dependency.archives 0.147 s 0.149 s
Dependency.attachments 0.045 s 0.031 s
Dependency.attachment_ids 0.045 s 0.030 s
Dependency.files 0.185 s 0.025 s
Dependency.media 0.264 s 0.136 s
Dependency.removed_media 0.250 s 0.126 s
Dependency.table_ids 0.053 s 0.040 s
Dependency.tables 0.046 s 0.031 s
Dependency.archive(1000 files) 0.005 s 0.006 s
Dependency.bit_depth(1000 files) 0.004 s 0.004 s
Dependency.channels(1000 files) 0.004 s 0.004 s
Dependency.checksum(1000 files) 0.004 s 0.004 s
Dependency.duration(1000 files) 0.004 s 0.004 s
Dependency.format(1000 files) 0.004 s 0.004 s
Dependency.removed(1000 files) 0.004 s 0.004 s
Dependency.sampling_rate(1000 files) 0.004 s 0.004 s
Dependency.type(1000 files) 0.005 s 0.004 s
Dependency.version(1000 files) 0.004 s 0.004 s
Dependency._add_attachment() 0.061 s 0.074 s
Dependency._add_media(1000 files) 0.050 s 0.065 s
Dependency._add_meta() 0.124 s 0.118 s
Dependency._drop() 0.078 s 0.076 s
Dependency._remove() 0.068 s 0.062 s
Dependency._update_media() 0.073 s 0.074 s
Dependency._update_media_version(1000 files) 0.008 s 0.008 s

@hagenw hagenw marked this pull request as ready for review February 6, 2024 15:48
@hagenw hagenw merged commit 91528e4 into main Feb 6, 2024
7 checks passed
@hagenw hagenw deleted the speed-dependencies-lists branch February 6, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant