Speed up app startup (use rename instead of copy for log file rotation)#30312
Open
futpib wants to merge 1 commit intotelegramdesktop:devfrom
Open
Speed up app startup (use rename instead of copy for log file rotation)#30312futpib wants to merge 1 commit intotelegramdesktop:devfrom
futpib wants to merge 1 commit intotelegramdesktop:devfrom
Conversation
Member
|
@futpib Nice, thanks for all your findings, I hope to review them soon-ish. |
ilya-fedin
suggested changes
Feb 18, 2026
Contributor
|
Could you squash? |
9ccfc16 to
cc85490
Compare
Contributor
Author
|
Squashed |
ilya-fedin
approved these changes
Feb 18, 2026
Replace the expensive file copy in Logs::instanceChecked() with an atomic rename. The old code copied log_startX.txt to log.txt then deleted the original, which took ~83ms of synchronous I/O. A simple rename on the same filesystem is nearly instant (~0.3ms).
cc85490 to
1c7e95b
Compare
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.
Replace the expensive file copy in Logs::instanceChecked() with an atomic rename. The old code copied log_startX.txt to log.txt then deleted the original, which took ~83ms of synchronous I/O. A simple rename on the same filesystem is nearly instant (~0.3ms).
Admittedly my logs were larger than usual because i added a ton of
PROFILE_LOG's