Skip to content

Conversation

@Gerg
Copy link
Member

@Gerg Gerg commented Jan 24, 2026

Update Spring preloader binstubs

Improve Spring preloading

  • Load the "init_block" of spec_helper pre-fork when using Spring
    • Previously the init_block was only used by Spork.
    • Spring would run it on every fork. This made tests load slower and
      reduced the benefit of using Spring, since less was being preloaded
      than could be.
  • I blindly copied over the current init/run blocks, without
    investigating in any depth. It's possible that more can be moved into
    the "init" method, to further reduce test load times when using
    Spring. This could be a worthwhile follow-up, especially if/when Spork
    is removed.
  • Extract out a SpecHelperHelper module so the "init_block" can be
    shared between spec_helper and Spring
  • Enforce that SpecHelperHelper.init only runs once. That way it doesn't
    run post-fork, which is a minor performance improvement and means we
    don't need to worry about everything in there being idempotent.
  • Add documentation to spec/README

Related to #4800


  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

- Load the "init_block" of spec_helper pre-fork when using Spring
  - Previously the init_block was only used by Spork.
  - Spring would run it on every fork. This made tests load slower and
    reduced the benefit of using Spring, since less was being preloaded
    than could be.
- I blindly copied over the current init/run blocks, without
  investigating in any depth. It's possible that more can be moved into
  the "init" method, to further reduce test load times when using
  Spring. This could be a worthwhile follow-up, especially if/when Spork
  is removed.
- Extract out a SpecHelperHelper module so the "init_block" can be
  shared between spec_helper and Spring
- Enforce that SpecHelperHelper.init only runs once. That way it doesn't
  run post-fork, which is a minor performance improvement and means we
  don't need to worry about everything in there being idempotent.
- Add documentation to spec/README
@Gerg Gerg force-pushed the fix-spring-preloader branch from 62e7453 to 95f76c6 Compare January 24, 2026 21:20
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.

1 participant