Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
94639115
Commit
94639115
authored
Jun 13, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
5c89a2e5
d8b361af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/commit.rb
app/models/commit.rb
+1
-1
changelogs/unreleased/sh-speed-up-commit-loading.yml
changelogs/unreleased/sh-speed-up-commit-loading.yml
+5
-0
spec/models/commit_spec.rb
spec/models/commit_spec.rb
+8
-0
No files found.
app/models/commit.rb
View file @
94639115
...
...
@@ -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
|
...
...
changelogs/unreleased/sh-speed-up-commit-loading.yml
0 → 100644
View file @
94639115
---
title
:
Speed up commit loads by disabling BatchLoader replace_methods
merge_request
:
29633
author
:
type
:
performance
spec/models/commit_spec.rb
View file @
94639115
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment