-
Notifications
You must be signed in to change notification settings - Fork 105
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
Implement a threadpool for faster builds. #282
base: master
Are you sure you want to change the base?
Conversation
I don't really know ruby (this is my first ruby PR) so please review carefully! |
This is amazing work, thank you! I've been wanting this forever. I'm out of town on a work trip at the moment so I can't easily pull it down and test it, but I'll get back to you as soon as I can once I get a chance to. |
Fixes rbuchberger#225 This implements a global Concurrent::ThreadPoolExecutor from concurrent-ruby to avoid memory blowup, and de-duplicates files before generation so we no longer need to rely on filesystem consistency to avoid double-generating images. This is an alternate to rbuchberger#282 with a litle bit more complexity, but with the added benefits that all image generation can happen in a single ThreadPool.
Thanks so much! I have 2 versions, this one and #283 - both of which do the same thing but in different ways |
@aebrahim - you mind if I go ahead and merge this version, then replace it if we get the global thread pool working? |
Sounds good to me! |
Using JPT for an image-heavy website, I was really pleased to see this PR. I've tried to use it, but I came across this error:
I've also tried using |
@antoinevth - Sorry it's not in a working state! This has been on the back burner a bit for me, but you're not the first one to mention how useful this would be. I'll try and find time to get it working, though no promises. |
Fixes #225
Uses
Concurrent::ThreadPoolExecutor
from concurrent-ruby to avoid memory blowup, and de-duplicates files before generation so we no longer need to rely on filesystem consistency to avoid double-generating images.In my experience on a 4 core/8 thread system, this optimization halves my build times.