Skip to content

Use MAKE="make -j$(nproc)" to speed up bundle install step #149

Open
@olivier-thatch

Description

@olivier-thatch
RUN MAKE="make -j$(nproc)" bundle install && \

This will parallelize compilation for gems with native extensions.

I tested this with our Rails app on my laptop (Macbook M3 Pro):

  • default (no parallelization): ~112 seconds for the bundle install step
  • with 2 CPUs: ~85 seconds
  • with 4 CPUs: ~64 seconds

We could make this configurable to play it safe, but I don't think there's much upside to not doing this.

(Also, bundle has its own --jobs argument, but it didn't seem to make any noticeable difference when I tried it. I assume the GVL prevents bundle from being able to truly parallelize work.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions