Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2015-10-15 16:41:17 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2015-10-15 16:41:17 +0300
commit5ce933599c1c1407620a340de4947497576ad12a (patch)
treec12c26b807c314cd004d8ddebda0aa1421aa5ec5 /spec/benchmarks
parentc0a6836be48bdf9a32ac2c9e610f62aef1e2e3f7 (diff)
parent72f428c7d217a5c40ed87d68ab9100e4c8754633 (diff)
Merge branch 'user-by-login-performance' into 'master'
Improve User.by_login performance This greatly speeds up the performance of `User.by_login`. I adopted some changes from @haynes in this patch, the credits go to him for coming up with those originally. Fixes #2341 See merge request !1545
Diffstat (limited to 'spec/benchmarks')
-rw-r--r--spec/benchmarks/models/user_spec.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/benchmarks/models/user_spec.rb b/spec/benchmarks/models/user_spec.rb
index 168be20b7a5..cc5c3904193 100644
--- a/spec/benchmarks/models/user_spec.rb
+++ b/spec/benchmarks/models/user_spec.rb
@@ -11,7 +11,9 @@ describe User, benchmark: true do
end
end
- let(:iterations) { 1000 }
+ # The iteration count is based on the query taking little over 1 ms when
+ # using PostgreSQL.
+ let(:iterations) { 900 }
describe 'using a capitalized username' do
benchmark_subject { User.by_login('Alice') }