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

Concurrent processing assets [3.x backport] #470

Closed
wants to merge 3 commits into from

Conversation

wjordan
Copy link
Contributor

@wjordan wjordan commented Apr 11, 2017

This PR enables concurrent processing of assets, backported to target the latest stable (3.x) release of Sprockets. Similar in scope to #469 (which targets the master branch).

Use-case is the same as #469, to allow time-consuming custom Processor steps (in my use-case, an image-optimization preprocessor provided by image_optim_rails) to leverage multiple CPU cores for performance gains.

Notes:

  • Since the concurrent Exporter/Writer code in the 3.x branch is not controlled by any configuration option, the concurrency in this PR is similarly non-configurable. Open to ideas/suggestions on whether/how to improve this.

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @schneems (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rails-bot
Copy link

warning Warning warning

  • Pull requests are usually filed against the master branch for this repo, but this one is against 3.x. Please double check that you specified the right target!

Use `Thread#stop`/`#run` instead of `#sleep` to avoid OS-sensitive race condition.
@wjordan wjordan force-pushed the concurrent_asset_bundle_3.x branch from 500d8a0 to 307933e Compare March 3, 2018 05:40
Soft-limit max concurrency to lower of 8 or current processor count.
@schneems
Copy link
Member

I'm hesitant to backport this feature as there have been some bug reports with it on sprockets 4. Let's keep new feature development to Sprockets 4. Thanks for the PR, sorry for the extreme delay.

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.

None yet

3 participants