Improve speed of write_gmt#76
Open
TylerSagendorf wants to merge 2 commits into
Open
Conversation
Contributor
|
Looks good, thanks @TylerSagendorf ! |
Author
|
@tnat1031 No problem! Actually, hold off on merging. I have a fix for the increased memory usage that I will commit tonight. |
Contributor
|
ah ok, I will stand by |
Author
|
Thank you for waiting, @tnat1031. The memory usage is now about the same as the original, but it is a bit slower than my first version. If you would prefer the faster version, I can revert the latest commit. Otherwise, I don't have any other changes to make. |
Contributor
|
Thanks Tyler, I think this looks fine. Unfortunately I'm no longer a member
of the cmap organization so I can't merge this PR in this repo. I have my
own fork here: https://github.com/tnat1031/cmapR which I've been using to
sync updates to Bioconductor. You're welcome to submit your PR there and
I'll merge it in.
…On Mon, Jul 20, 2026 at 7:20 PM Tyler Sagendorf ***@***.***> wrote:
*TylerSagendorf* left a comment (cmap/cmapR#76)
<#76 (comment)>
Thank you for waiting, @tnat1031 <https://github.com/tnat1031>. The
memory usage is now about the same as the original, but it is a bit slower
than my first version. If you would prefer the faster version, I can revert
the latest commit. Otherwise, I don't have any other changes to make.
# A tibble: 2 × 9
expression min median `itr/sec` mem_alloc `gc/sec` n_itr n_gc total_time
<bch:expr> <dbl> <dbl> <dbl> <bch:byt> <dbl> <int> <dbl> <bch:tm>
1 original 49.2 47.7 1 59MB 1 10 28 6.93m
2 new 1 1 47.8 61.4MB 32.4 10 19 8.7s
—
Reply to this email directly, view it on GitHub
<#76?email_source=notifications&email_token=AAO6F347RYJRPZX2XRZG6RL5F2SKXA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBSHAYTSMJYGUY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5028191851>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAO6F37CDJW6PKDAR6JRFZ35F2SKXAVCNFSNUABEKJSXA33TNF2G64TZHM4DMNBZHE4TQNJ3JFZXG5LFHM2DSMRQHA2TOOBYG6QXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AAO6F37Z5LMYHLKFZEZBATT5F2SKXA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBSHAYTSMJYGUY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/AAO6F3ZCAGUNTEKPXK53LI35F2SKXA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBSHAYTSMJYGUY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello @tnat1031, I improved the speed of
write_gmt()at the cost of extra memory allocation. Since file I/O is so expensive, this new version instead flattens the input list into a single string so that only onewrite()call is needed.According to the benchmark results below, the new version is ~62x faster and uses 1.4x as much memory.