Skip to content

Benchmarks for eager_load functionality - #6163

Merged
jamis merged 2 commits into
mongodb:masterfrom
jamis:eager-load-benchmarks
Jul 2, 2026
Merged

Benchmarks for eager_load functionality#6163
jamis merged 2 commits into
mongodb:masterfrom
jamis:eager-load-benchmarks

Conversation

@jamis

@jamis jamis commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This PR just adds some benchmarks for measuring the effectiveness of the #eager_load feature.

@jamis
jamis requested a review from a team as a code owner July 1, 2026 14:18
@jamis
jamis requested review from comandeo-mongo and Copilot July 1, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new performance benchmark scenarios to measure Mongoid #eager_load behavior across more complex association patterns (subclass-defined associations, references inside embedded documents, and polymorphic belongs_to), expanding the existing perf/benchmark_eager_load.rb script and its supporting model definitions.

Changes:

  • Add additional Mongoid model classes in perf/models.rb to represent PR #6158-related eager_load scenarios.
  • Extend perf/benchmark_eager_load.rb to generate scenario data and run new benchmark sections for subclass, embedded-reference, and polymorphic association cases.
  • Introduce a keep-data CLI flag to reuse an existing dataset instead of purging/reseeding each run.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
perf/models.rb Adds benchmark-only models for subclass, embedded-reference, and polymorphic association scenarios.
perf/benchmark_eager_load.rb Adds dataset setup and benchmark cases for the new scenarios; adds keep-data option to skip purge/reseed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to +13
if ARGV.include?('keep-data')
puts 'reusing existing data'
else
Mongoid.purge!
@jamis
jamis merged commit cc06903 into mongodb:master Jul 2, 2026
76 checks passed
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.

3 participants