During development I ran into a sizable problem with startup times and Bundler.setup (even with --frozen enabled), and I was able to isolate this down to a specific gem taking about 65% of the setup time by measuring the time spent requiring each top level dependency in bundler (via the require method). Thought this may be useful to someone else, so just in case I've taken a stab at a pull request. This adds a 'bundle benchmark' task that outputs load times as follows:
$ bundle benchmark
Gem require times as included by bundle:
* rails (164 ms)
* will_paginate (7 ms)
* migrant (300 ms)
* pickle (1424 ms)
* capybara (258 ms)
* database_cleaner (14 ms)
* geokit (362 ms)
* texticle (12 ms)
Obviously this is not totally accurate (requiring of gems in gems, etc.) but it was useful enough to point me in the right direction.
Add bundle benchmark to show load times for each gem in your bundle
Benchmark on each file rather than each dependency
This is pretty neat. Do you think you could add docs to the manpage describing it, too? Thanks!
Looks like this code was removed in 20dc4b5. However, I can't find anything about the bundler-tools project. Any help would be great!
Bundler-tools does not yet exist! I would be very excited if you helped create Bundler extensions that aren't in core, though. :) There is more information in bundler/bundler-features#8.
I would be happy to provide guidance and code review for an implementation of Bundler extensions based on that ticket, and create repos inside the Bundler organization to host useful tools like benchmark/profile.
Thanks for the quick response. It looks like writing a plugin system is pretty involved, so I just went with a separate gem for now.