Skip to content
Snippets Groups Projects
Commit 1813c7a6 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre Committed by 🤖 GitLab Bot 🤖
Browse files

Merge branch 'sh-speed-up-commit-loading' into 'master'

Speed up commit loads by disabling BatchLoader replace_methods

See merge request gitlab-org/gitlab-ce!29633

(cherry picked from commit d8b361af)

89fa2538 Speed up merge request loads by disabling BatchLoader replace_methods
18020f00 Speed up commit loads by disabling BatchLoader replace_methods
parent 1bec3a78
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -94,7 +94,7 @@ class Commit
end
 
def lazy(project, oid)
BatchLoader.for({ project: project, oid: oid }).batch do |items, loader|
BatchLoader.for({ project: project, oid: oid }).batch(replace_methods: false) do |items, loader|
items_by_project = items.group_by { |i| i[:project] }
 
items_by_project.each do |project, commit_ids|
Loading
Loading
---
title: Speed up commit loads by disabling BatchLoader replace_methods
merge_request: 29633
author:
type: performance
Loading
Loading
@@ -44,6 +44,14 @@ describe Commit do
expect(commit.id).to eq(oids[i])
end
end
it 'does not attempt to replace methods via BatchLoader' do
subject.each do |commit|
expect(commit).to receive(:method_missing).and_call_original
commit.id
end
end
end
 
context 'when not found' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment