Skip to content
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

Don't read stdout into memory when not needed #143

Merged
merged 28 commits into from
Aug 9, 2021
Merged

Conversation

soenkehahn
Copy link
Owner

@soenkehahn soenkehahn commented Aug 4, 2021

cradle needs to read what's written to stdout into memory when the user wants to capture stdout, e.g. with StdoutUntrimmed. However currently it also reads all of stdout into memory when not capturing stdout, which is unnecessary. It's also conceivable (when there's lots of output) that this may cause problems. This PR avoids collecting stdout into memory when it's not captured.

The same could be done for stderr. Not sure whether that's as important as doing it for stdout. In any case it should be done in a separate PR.

This PR is half a fix for #26.

@soenkehahn soenkehahn changed the title [BROKEN] Add memory test for not consuming stdout Don't read stdout into memory when not needed Aug 6, 2021
@soenkehahn soenkehahn marked this pull request as ready for review August 6, 2021 18:38
src/collected_output.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of minor comments, but looks good overall.

memory-test/src/bin/produce_bytes.rs Outdated Show resolved Hide resolved
memory-test/src/bin/run_test.rs Outdated Show resolved Hide resolved
memory-test/src/bin/run_test.rs Show resolved Hide resolved
memory-test/src/bin/cradle_user.rs Outdated Show resolved Hide resolved
memory-test/src/bin/produce_bytes.rs Outdated Show resolved Hide resolved
src/collected_output.rs Show resolved Hide resolved
src/error.rs Outdated Show resolved Hide resolved
src/error.rs Outdated Show resolved Hide resolved
src/error.rs Outdated Show resolved Hide resolved
src/error.rs Outdated Show resolved Hide resolved
@soenkehahn soenkehahn enabled auto-merge (squash) August 8, 2021 16:05
@soenkehahn soenkehahn disabled auto-merge August 9, 2021 00:15
@@ -73,6 +73,7 @@ jobs:
- name: Install just
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to get a specific version of just, you can do curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to DEST --tag VERSION

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that work on windows?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhhhhhhh, I don't actually know 😅

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, no, it doesn't. :|

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened this issue to explain what the actual problems are: casey/just#943. I.e. I'm not at all interested in getting a specific just version, the newest would be just fine. I just want a way that works on github CI on all platforms.

@soenkehahn soenkehahn enabled auto-merge (squash) August 9, 2021 15:10
@soenkehahn soenkehahn merged commit 1e6c499 into master Aug 9, 2021
@soenkehahn soenkehahn deleted the optimization branch August 9, 2021 15:15
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.

2 participants