Make chunk sizes configurable for ProcessBuilder

Open
#3,701 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
scala

Research direction

Locate the JVM implementation of ProcessBuilder.spawn and inspect how stdout and stderr currently read 8192-byte chunks. Check how the existing stdout and stderr APIs are tested, then make the chunk size configurable while preserving the current default of 8192 and verify large transfers use the requested size.

Written by the indexing model from the issue text.

Description

The JVM implementation for the stdout and stderr streams for Processes generated by ProcessBuilder.spawn currently use a chunk size of 8192. While this is probably fine for most use cases I've noticed that it can limit throughput drastically when large amounts of data are transferred this way.

It would be helpful, if the chunk size would be a parameter, either of ProcessBuilder or by having a variant of stderr that takes a chunkSize parameter like
def stdout(chunkSize: Int = 8192): Stream[F, Byte]

Dominant language
Scala
Stars
2.5k
Forks
633
Avg merge
4d 16h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from typelevel/fs2

All issues in typelevel/fs2

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.