Skip to content

Speed operations on large responses - #61

Merged
sylikc merged 1 commit into
sylikc:masterfrom
prutschman:large-binary-blob-efficiency
Dec 30, 2022
Merged

Speed operations on large responses#61
sylikc merged 1 commit into
sylikc:masterfrom
prutschman:large-binary-blob-efficiency

Conversation

@prutschman

Copy link
Copy Markdown

Keep a list of bytes instead of repeatedly appending (copying) to the bytes object.

Keep a list of bytes instead of repeatedly appending (copying) to the bytes
object.
@prutschman

Copy link
Copy Markdown
Author

Address #60

@sylikc

sylikc commented Dec 17, 2022

Copy link
Copy Markdown
Owner

I finally got a chance to understand the reverse() built-in function and how it works... that is a GREAT solution to the problem at hand, it's super fast to just return a reverse iterable instead of actually reversing the list. I think that is the optimal way to implement this check

@sylikc sylikc added bug Something isn't working enhancement New feature or request labels Dec 17, 2022
Comment thread exiftool/exiftool.py

# ======================================================================================================================

def _get_buffer_end(buffer_list: List[bytes], bytes_needed: int) -> bytes:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adhering to the typing... the code is great!

sylikc added a commit that referenced this pull request Dec 30, 2022
This PR addresses the append() operations and uses lists and reverse() to speed up getting exiftool output

Merge PR #61 by https://github.com/prutschman
@sylikc
sylikc merged commit 2026c75 into sylikc:master Dec 30, 2022
@sylikc sylikc linked an issue Dec 30, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

High CPU consumption when using "-b" with large embedded binary data

2 participants