Skip to content

Retain at most 256kb of combined output from Git - #19474

Merged
niik merged 4 commits into
expose-encoding-overloadsfrom
combined-output-tailstream-based-on-remove-spawnandcomplete
Nov 5, 2024
Merged

niik merged 4 commits into
expose-encoding-overloadsfrom
combined-output-tailstream-based-on-remove-spawnandcomplete

Conversation

@niik

@niik niik commented Oct 30, 2024

Copy link
Copy Markdown
Member

Closes #[issue number]

Description

I'm working on multiple fronts to improve GitHub Desktop's handling of large Git output. One problem we're contending with (believe it or not) is the maximum string length in v8 which used to be 256Mb and which I believe is now 512Mb but don't quote me on that.

To avoid marshalling output to strings when we don't have to (diffs for example) we're now using buffer encoding in a few select locations but the combinedOutput is still a string and would negate all optimisations by always ensuring that we create a string totalling stderr + stdout's length.

The sole purpose of combinedOutput is to be able to provide "terminal-like" output to the user (see #9945) so we really don't need more than the tail-end of a long output (that's where the error will be).

As such, this PR introduces a new stream which only retains the last 256kb of output piped through it, ensuring that we can deliver a good experience to users encountering errors while simultaneously ensuring that we don't end up stringifying every commands output unnecessarily.

Screenshots

Release notes

Notes:

@akaday

This comment was marked as spam.

@niik
niik merged commit ce8eb5a into expose-encoding-overloads Nov 5, 2024
@niik
niik deleted the combined-output-tailstream-based-on-remove-spawnandcomplete branch November 5, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants