Skip to content

Stream files #1481

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

Merged
merged 1 commit into from
Jul 1, 2025
Merged

Stream files #1481

merged 1 commit into from
Jul 1, 2025

Conversation

NathanBaulch
Copy link
Contributor

I noticed a few places where files were being generated with StringBuilder in memory before writing to the FS.
Better to use StreamWriter and write directly to the FS rather than consuming unnecessary memory.
It's also a bit more readable and less error prone using WriteLine instead of \n IMO.
I've left the string interpolation in place because the code reads a little better. In theory those could be broken into multiple calls to Write to avoid even more string building behind the scenes.

@love-linger love-linger merged commit 25e6ade into sourcegit-scm:develop Jul 1, 2025
13 checks passed
@love-linger love-linger self-assigned this Jul 1, 2025
@love-linger love-linger added the enhancement New feature or request label Jul 1, 2025
@NathanBaulch NathanBaulch deleted the streamfiles branch July 1, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
2 participants