gitlab-org--gitlab-foss/app/models
Yorick Peterse f2992cf343 Optimize Project#ci_service(s)
The method Project#ci_services would load all services into memory
(including _all_ their columns) and then use Enumerable#select to reduce
the list. Project#ci_service in turn would further reduce this list down
to just 1 Service instance.

Instead of doing all this in Ruby we can just offload the work to the
database, reducing the amount of time spent in these methods. These
changes reduce the time of the first call to Project#ci_services from
around 240 ms to around 10 ms, though the final timings will vary based
on database load. Because Project#ci_service is memoized there's no
further overhead introduced by using a database query.

Fixes gitlab-org/gitlab-ce#14186
2016-03-10 15:32:31 +01:00
..
ci Fix Merge When Succeeded for multiple stages 2016-02-19 23:24:31 +01:00
concerns Updates from last code review. 2016-03-06 23:07:19 -05:00
hooks
members
network
project_services Add commit message to JIRA's notification payload. 2016-03-03 09:55:53 -05:00
.gitkeep
ability.rb Handle permissions for ExternalIssue instances 2016-03-09 17:10:43 +01:00
abuse_report.rb
appearance.rb Branded login page also in CE 2016-02-26 15:50:51 +01:00
application_setting.rb
audit_event.rb
blob.rb Refactor caching code 2016-03-07 14:27:53 +01:00
broadcast_message.rb
commit.rb Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
commit_range.rb
commit_status.rb Fix Merge When Succeeded for multiple stages 2016-02-19 23:24:31 +01:00
deploy_key.rb
deploy_keys_project.rb
email.rb
event.rb
external_issue.rb
forked_project_link.rb
generic_commit_status.rb
global_label.rb Updates from last code review. 2016-03-06 23:07:19 -05:00
global_milestone.rb Updates from last code review. 2016-03-06 23:07:19 -05:00
group.rb
identity.rb
issue.rb
jira_issue.rb
key.rb
label.rb Remove redundant code in cross project labels implementation 2016-03-03 10:41:11 +01:00
label_link.rb
lfs_object.rb
lfs_objects_project.rb
member.rb
merge_request.rb Merge branch 'issue_13621_2' into 'master' 2016-03-07 17:18:25 +00:00
merge_request_diff.rb Show at most 100 commits in the web UI 2016-03-04 15:17:12 +01:00
milestone.rb Updates from last code review. 2016-03-06 23:07:19 -05:00
namespace.rb
note.rb Merge branch 'rs-note-delegates-mentionable' 2016-03-07 09:38:16 +01:00
notification.rb
personal_snippet.rb Remove `Snippet#expires_at` 2016-03-05 18:12:17 -05:00
project.rb Optimize Project#ci_service(s) 2016-03-10 15:32:31 +01:00
project_import_data.rb
project_snippet.rb Remove `Snippet#expires_at` 2016-03-05 18:12:17 -05:00
project_team.rb Allow `ProjectTeam#human_max_access` to return "Owner" 2016-02-18 16:39:59 -05:00
project_wiki.rb Cleaned up Repository#initialize 2016-02-16 12:13:13 +01:00
protected_branch.rb
release.rb
repository.rb Call after_create_branch in Repository#add_branch 2016-03-08 18:19:40 +01:00
security_event.rb
sent_notification.rb
service.rb
snippet.rb Remove `Snippet#expires_at` 2016-03-05 18:12:17 -05:00
spam_log.rb
spam_report.rb
subscription.rb
todo.rb Does not raise an error when Todo is already marked as done 2016-02-23 10:43:29 -03:00
tree.rb
user.rb Merge branch 'rs-avatar-validation' into 'master' 2016-03-01 16:03:38 +00:00
users_star_project.rb
wiki_page.rb