derailed_benchmarks 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -5
- data/CHANGELOG.md +5 -0
- data/README.md +14 -6
- data/derailed_benchmarks.gemspec +5 -3
- data/lib/derailed_benchmarks/tasks.rb +2 -1
- data/lib/derailed_benchmarks/version.rb +1 -1
- data/test/rails_app/app/controllers/authenticated_controller.rb +1 -1
- metadata +22 -11
- data/Gemfile.lock +0 -139
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: feeca2d25e7ddd4fc5a6d2fedb2236db29290259
|
4
|
+
data.tar.gz: b4bd68d5b8f4067aff1f8ef4e4fc90e1cabcaa59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5b16bc6f6e738d1a205b4408e21d5079ce9de794d9380f8ff6368ccd8456dc71c8e60c623c80b80379ec5564316cada4b298d3b11d960dc3120036d3df004bf
|
7
|
+
data.tar.gz: d584bd3dda3528b2ba22bfe21f035f88a68c69f51c1c1932faa94d8edea93751fdb03125bbee345de2cf54a96ee36c59f78aa9b39c296cfce85cf1c7d3e7467d
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -25,7 +25,7 @@ curl 7.37.1 #...
|
|
25
25
|
Put this in your gemfile:
|
26
26
|
|
27
27
|
```ruby
|
28
|
-
gem '
|
28
|
+
gem 'derailed_benchmarks', group: :development
|
29
29
|
```
|
30
30
|
|
31
31
|
Then run `$ bundle install`.
|
@@ -116,7 +116,7 @@ If you want to see everything that requires `fog/core` you can run `CUT_OFF=0 bu
|
|
116
116
|
Update: While `mime/types` looks horrible in these examples, it's been fixed. You can add this to the top of your gemfile for free memory:
|
117
117
|
|
118
118
|
```ruby
|
119
|
-
gem 'mime-types', '~> 2.
|
119
|
+
gem 'mime-types', [ '~> 2.6', '>= 2.6.1' ], require: 'mime/types/columnar'
|
120
120
|
```
|
121
121
|
|
122
122
|
### Objects created at Require time
|
@@ -183,7 +183,7 @@ Once you can boot a console in production, you'll need to be able to boot a serv
|
|
183
183
|
$ RAILS_ENV=production rails server
|
184
184
|
```
|
185
185
|
|
186
|
-
You may need to disable enforcing SSL or other domain restrictions
|
186
|
+
You may need to disable enforcing SSL or other domain restrictions temporarily. If you do these, don't forget to add them back in before deploying any code (eek!).
|
187
187
|
|
188
188
|
You can get information from STDOUT if you're using `rails_12factor` gem, or from `log/production.log` by running
|
189
189
|
|
@@ -269,7 +269,7 @@ $ TEST_COUNT=10 bundle exec derailed exec perf:objects
|
|
269
269
|
|
270
270
|
This is an expensive operation, so you likely want to keep the count lowish. Once you've identified a hotspot read [how ruby uses memory](http://www.sitepoint.com/ruby-uses-memory/) for some tips on reducing object allocations.
|
271
271
|
|
272
|
-
This is
|
272
|
+
This is similar to `$ bundle exec derailed bundle:objects` however it includes objects created at runtime. It's much more useful for actual production performance debugging, the other is more useful for library authors to debug.
|
273
273
|
|
274
274
|
## I want a Heap Dump
|
275
275
|
|
@@ -377,7 +377,7 @@ Calculating -------------------------------------
|
|
377
377
|
ips 3.306 (± 0.0%) i/s - 17.000
|
378
378
|
```
|
379
379
|
|
380
|
-
This will hit an endpoint in your application using [benchmark-ips](https://github.com/evanphx/benchmark-ips). In "iterations per second" a higher value is always better. You can run your code change several times using this method, and then run your "baseline" codebase (without your changes) to see how it affects your overall performance. You'll want to run and record the results several times (including the std deviation) so you can help eliminate noise. Benchmarking is hard, this technique isn't perfect but it's
|
380
|
+
This will hit an endpoint in your application using [benchmark-ips](https://github.com/evanphx/benchmark-ips). In "iterations per second" a higher value is always better. You can run your code change several times using this method, and then run your "baseline" codebase (without your changes) to see how it affects your overall performance. You'll want to run and record the results several times (including the std deviation) so you can help eliminate noise. Benchmarking is hard, this technique isn't perfect but it's definitely better than nothing.
|
381
381
|
|
382
382
|
If you care you can also run pure benchmark (without ips):
|
383
383
|
|
@@ -409,7 +409,15 @@ By default tasks will hit your homepage `/`. If you want to hit a different url
|
|
409
409
|
$ PATH_TO_HIT=/users/new bundle exec derailed exec perf:mem
|
410
410
|
```
|
411
411
|
|
412
|
-
|
412
|
+
This method accepts a full uri. For example, allowing you to hit a subdomain endpoint:
|
413
|
+
|
414
|
+
```
|
415
|
+
$ PATH_TO_HIT=http://subdomain.lvh.me:3000/users/new bundle exec derailed exec perf:mem
|
416
|
+
```
|
417
|
+
|
418
|
+
Beware that you cannot combine a full uri with `USE_SERVER`.
|
419
|
+
|
420
|
+
### Using a real web server with `USE_SERVER`
|
413
421
|
|
414
422
|
All tests are run without a webserver (directly using `Rack::Mock` by default), if you want to use a webserver set `USE_SERVER` to a Rack::Server compliant server, such as `webrick`.
|
415
423
|
|
data/derailed_benchmarks.gemspec
CHANGED
@@ -18,15 +18,17 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
+
gem.required_ruby_version = ">= 2.1.0"
|
22
|
+
|
21
23
|
gem.add_dependency "heapy", "~> 0"
|
22
24
|
gem.add_dependency "memory_profiler", "~> 0"
|
23
25
|
gem.add_dependency "get_process_mem", "~> 0"
|
24
26
|
gem.add_dependency "benchmark-ips", "~> 2"
|
25
27
|
gem.add_dependency "rack", ">= 1"
|
26
|
-
gem.add_dependency "rake", "> 10", "<
|
28
|
+
gem.add_dependency "rake", "> 10", "< 13"
|
27
29
|
gem.add_dependency "thor", "~> 0.19"
|
28
30
|
|
29
31
|
gem.add_development_dependency "capybara", "~> 2"
|
30
|
-
gem.add_development_dependency "rails", "
|
31
|
-
gem.add_development_dependency "devise", "
|
32
|
+
gem.add_development_dependency "rails", "> 3", "< 6"
|
33
|
+
gem.add_development_dependency "devise", "> 3", "< 5"
|
32
34
|
end
|
@@ -6,7 +6,7 @@ namespace :perf do
|
|
6
6
|
|
7
7
|
ENV["SECRET_KEY_BASE"] ||= "foofoofoo"
|
8
8
|
|
9
|
-
ENV['LOG_LEVEL']
|
9
|
+
ENV['LOG_LEVEL'] ||= "FATAL"
|
10
10
|
|
11
11
|
require 'rails'
|
12
12
|
|
@@ -269,6 +269,7 @@ namespace :perf do
|
|
269
269
|
require 'objspace'
|
270
270
|
|
271
271
|
file_name = "tmp/#{Time.now.iso8601}-heap.dump"
|
272
|
+
FileUtils.mkdir_p("tmp")
|
272
273
|
ObjectSpace.trace_object_allocations_start
|
273
274
|
puts "Running #{ TEST_COUNT } times"
|
274
275
|
TEST_COUNT.times {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: derailed_benchmarks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Schneeman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: heapy
|
@@ -89,7 +89,7 @@ dependencies:
|
|
89
89
|
version: '10'
|
90
90
|
- - "<"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: '
|
92
|
+
version: '13'
|
93
93
|
type: :runtime
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -99,7 +99,7 @@ dependencies:
|
|
99
99
|
version: '10'
|
100
100
|
- - "<"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '13'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: thor
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,30 +132,42 @@ dependencies:
|
|
132
132
|
name: rails
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
|
-
- - "
|
135
|
+
- - ">"
|
136
136
|
- !ruby/object:Gem::Version
|
137
137
|
version: '3'
|
138
|
+
- - "<"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '6'
|
138
141
|
type: :development
|
139
142
|
prerelease: false
|
140
143
|
version_requirements: !ruby/object:Gem::Requirement
|
141
144
|
requirements:
|
142
|
-
- - "
|
145
|
+
- - ">"
|
143
146
|
- !ruby/object:Gem::Version
|
144
147
|
version: '3'
|
148
|
+
- - "<"
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '6'
|
145
151
|
- !ruby/object:Gem::Dependency
|
146
152
|
name: devise
|
147
153
|
requirement: !ruby/object:Gem::Requirement
|
148
154
|
requirements:
|
149
|
-
- - "
|
155
|
+
- - ">"
|
150
156
|
- !ruby/object:Gem::Version
|
151
157
|
version: '3'
|
158
|
+
- - "<"
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '5'
|
152
161
|
type: :development
|
153
162
|
prerelease: false
|
154
163
|
version_requirements: !ruby/object:Gem::Requirement
|
155
164
|
requirements:
|
156
|
-
- - "
|
165
|
+
- - ">"
|
157
166
|
- !ruby/object:Gem::Version
|
158
167
|
version: '3'
|
168
|
+
- - "<"
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '5'
|
159
171
|
description: " Go faster, off the Rails "
|
160
172
|
email:
|
161
173
|
- richard.schneeman+rubygems@gmail.com
|
@@ -168,7 +180,6 @@ files:
|
|
168
180
|
- ".travis.yml"
|
169
181
|
- CHANGELOG.md
|
170
182
|
- Gemfile
|
171
|
-
- Gemfile.lock
|
172
183
|
- README.md
|
173
184
|
- Rakefile
|
174
185
|
- bin/derailed
|
@@ -248,7 +259,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
248
259
|
requirements:
|
249
260
|
- - ">="
|
250
261
|
- !ruby/object:Gem::Version
|
251
|
-
version:
|
262
|
+
version: 2.1.0
|
252
263
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
253
264
|
requirements:
|
254
265
|
- - ">="
|
@@ -256,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
267
|
version: '0'
|
257
268
|
requirements: []
|
258
269
|
rubyforge_project:
|
259
|
-
rubygems_version: 2.
|
270
|
+
rubygems_version: 2.6.8
|
260
271
|
signing_key:
|
261
272
|
specification_version: 4
|
262
273
|
summary: Benchmarks designed to performance test your ENTIRE site
|
data/Gemfile.lock
DELETED
@@ -1,139 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
derailed_benchmarks (1.3.1)
|
5
|
-
benchmark-ips (~> 2)
|
6
|
-
get_process_mem (~> 0)
|
7
|
-
heapy (~> 0)
|
8
|
-
memory_profiler (~> 0)
|
9
|
-
rack (>= 1)
|
10
|
-
rake (> 10, < 12)
|
11
|
-
thor (~> 0.19)
|
12
|
-
|
13
|
-
GEM
|
14
|
-
remote: https://rubygems.org/
|
15
|
-
specs:
|
16
|
-
actionmailer (3.2.21)
|
17
|
-
actionpack (= 3.2.21)
|
18
|
-
mail (~> 2.5.4)
|
19
|
-
actionpack (3.2.21)
|
20
|
-
activemodel (= 3.2.21)
|
21
|
-
activesupport (= 3.2.21)
|
22
|
-
builder (~> 3.0.0)
|
23
|
-
erubis (~> 2.7.0)
|
24
|
-
journey (~> 1.0.4)
|
25
|
-
rack (~> 1.4.5)
|
26
|
-
rack-cache (~> 1.2)
|
27
|
-
rack-test (~> 0.6.1)
|
28
|
-
sprockets (~> 2.2.1)
|
29
|
-
activemodel (3.2.21)
|
30
|
-
activesupport (= 3.2.21)
|
31
|
-
builder (~> 3.0.0)
|
32
|
-
activerecord (3.2.21)
|
33
|
-
activemodel (= 3.2.21)
|
34
|
-
activesupport (= 3.2.21)
|
35
|
-
arel (~> 3.0.2)
|
36
|
-
tzinfo (~> 0.3.29)
|
37
|
-
activeresource (3.2.21)
|
38
|
-
activemodel (= 3.2.21)
|
39
|
-
activesupport (= 3.2.21)
|
40
|
-
activesupport (3.2.21)
|
41
|
-
i18n (~> 0.6, >= 0.6.4)
|
42
|
-
multi_json (~> 1.0)
|
43
|
-
arel (3.0.3)
|
44
|
-
bcrypt (3.1.10)
|
45
|
-
benchmark-ips (2.5.0)
|
46
|
-
builder (3.0.4)
|
47
|
-
capybara (2.4.4)
|
48
|
-
mime-types (>= 1.16)
|
49
|
-
nokogiri (>= 1.3.3)
|
50
|
-
rack (>= 1.0.0)
|
51
|
-
rack-test (>= 0.5.4)
|
52
|
-
xpath (~> 2.0)
|
53
|
-
devise (3.4.1)
|
54
|
-
bcrypt (~> 3.0)
|
55
|
-
orm_adapter (~> 0.1)
|
56
|
-
railties (>= 3.2.6, < 5)
|
57
|
-
responders
|
58
|
-
thread_safe (~> 0.1)
|
59
|
-
warden (~> 1.2.3)
|
60
|
-
erubis (2.7.0)
|
61
|
-
get_process_mem (0.2.0)
|
62
|
-
heapy (0.1.2)
|
63
|
-
hike (1.2.3)
|
64
|
-
i18n (0.7.0)
|
65
|
-
journey (1.0.4)
|
66
|
-
json (1.8.2)
|
67
|
-
mail (2.5.4)
|
68
|
-
mime-types (~> 1.16)
|
69
|
-
treetop (~> 1.4.8)
|
70
|
-
memory_profiler (0.9.6)
|
71
|
-
mime-types (1.25.1)
|
72
|
-
mini_portile (0.6.2)
|
73
|
-
multi_json (1.11.0)
|
74
|
-
nokogiri (1.6.6.2)
|
75
|
-
mini_portile (~> 0.6.0)
|
76
|
-
orm_adapter (0.5.0)
|
77
|
-
polyglot (0.3.5)
|
78
|
-
power_assert (0.2.3)
|
79
|
-
rack (1.4.5)
|
80
|
-
rack-cache (1.2)
|
81
|
-
rack (>= 0.4)
|
82
|
-
rack-ssl (1.3.4)
|
83
|
-
rack
|
84
|
-
rack-test (0.6.3)
|
85
|
-
rack (>= 1.0)
|
86
|
-
rails (3.2.21)
|
87
|
-
actionmailer (= 3.2.21)
|
88
|
-
actionpack (= 3.2.21)
|
89
|
-
activerecord (= 3.2.21)
|
90
|
-
activeresource (= 3.2.21)
|
91
|
-
activesupport (= 3.2.21)
|
92
|
-
bundler (~> 1.0)
|
93
|
-
railties (= 3.2.21)
|
94
|
-
railties (3.2.21)
|
95
|
-
actionpack (= 3.2.21)
|
96
|
-
activesupport (= 3.2.21)
|
97
|
-
rack-ssl (~> 1.3.2)
|
98
|
-
rake (>= 0.8.7)
|
99
|
-
rdoc (~> 3.4)
|
100
|
-
thor (>= 0.14.6, < 2.0)
|
101
|
-
rake (10.4.2)
|
102
|
-
rdoc (3.12.2)
|
103
|
-
json (~> 1.4)
|
104
|
-
responders (1.1.0)
|
105
|
-
railties (>= 3.2, < 5)
|
106
|
-
sprockets (2.2.3)
|
107
|
-
hike (~> 1.2)
|
108
|
-
multi_json (~> 1.0)
|
109
|
-
rack (~> 1.0)
|
110
|
-
tilt (~> 1.1, != 1.3.0)
|
111
|
-
sqlite3 (1.3.10)
|
112
|
-
test-unit (3.0.9)
|
113
|
-
power_assert
|
114
|
-
thor (0.19.1)
|
115
|
-
thread_safe (0.3.5)
|
116
|
-
tilt (1.4.1)
|
117
|
-
treetop (1.4.15)
|
118
|
-
polyglot
|
119
|
-
polyglot (>= 0.3.1)
|
120
|
-
tzinfo (0.3.44)
|
121
|
-
warden (1.2.3)
|
122
|
-
rack (>= 1.0)
|
123
|
-
xpath (2.0.0)
|
124
|
-
nokogiri (~> 1.3)
|
125
|
-
|
126
|
-
PLATFORMS
|
127
|
-
ruby
|
128
|
-
|
129
|
-
DEPENDENCIES
|
130
|
-
activerecord-jdbcsqlite3-adapter (~> 1.3.13)
|
131
|
-
capybara (~> 2)
|
132
|
-
derailed_benchmarks!
|
133
|
-
devise (~> 3)
|
134
|
-
rails (~> 3)
|
135
|
-
sqlite3
|
136
|
-
test-unit (~> 3.0)
|
137
|
-
|
138
|
-
BUNDLED WITH
|
139
|
-
1.11.2
|