Skip to content

Conversation

@prutschman
Copy link

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
Author

Address #60

@sylikc
Copy link
Owner

sylikc commented Dec 17, 2022

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

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

def _get_buffer_end(buffer_list: List[bytes], bytes_needed: int) -> bytes:
Copy link
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