Skip to content

Conversation

@zertosh
Copy link
Member

@zertosh zertosh commented Jul 22, 2015

An earlier attempt at this was 8168edf, which added a flag --write-on-done that waited until the entire bundle was done before beginning to write.

The current approach is better because it has the best of both worlds. It starts to write when data is actually available, but doesn't buffer everything. module-deps is the slowest part of the pipeline, however, it's actually deps-sort that causes the bottleneck – since it has to wait until all the rows are done before it can sort them.

This waits until browser-pack has something to be read before opening the write stream. This prevents issues with bundles that have a long processing time (mostly in module-deps), where you'd have 0 byte output file for a while before anything actually gets written to it.

Fixes #239 and #272

@zertosh zertosh force-pushed the cli-write-on-ready branch from 566c52e to 8168edf Compare October 25, 2015 19:24
@zertosh zertosh changed the title wait for bundle stream readable before creating output stream in cli Wait until there is some data before creating the output stream in the CLI Oct 25, 2015
@zertosh zertosh force-pushed the cli-write-on-ready branch from 8168edf to fbf08a0 Compare October 25, 2015 21:41
This waits until browser-pack has something to be read before opening the write stream. This prevents issues with bundles that have a long processing time (mostly in module-deps), where you'd have 0 byte output file for a while before anything actually gets written to it.

Fixes #239 and #272
@zertosh zertosh force-pushed the cli-write-on-ready branch from fbf08a0 to 4dfacff Compare October 25, 2015 21:55
zertosh added a commit that referenced this pull request Oct 25, 2015
Wait until there is some data before creating the output stream in the CLI
@zertosh zertosh merged commit b23c9c9 into master Oct 25, 2015
@zertosh zertosh deleted the cli-write-on-ready branch October 25, 2015 21:57
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