derailed_benchmarks 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/check_changelog.yml +10 -0
- data/CHANGELOG.md +4 -0
- data/README.md +0 -3
- data/derailed_benchmarks.gemspec +1 -1
- data/gemfiles/rails_6_0.gemfile +1 -1
- data/lib/derailed_benchmarks/core_ext/kernel_require.rb +8 -0
- data/lib/derailed_benchmarks/stats_from_dir.rb +16 -11
- data/lib/derailed_benchmarks/tasks.rb +1 -1
- data/lib/derailed_benchmarks/version.rb +1 -1
- data/test/derailed_benchmarks/stats_from_dir_test.rb +9 -5
- data/test/rails_app/config/environment.rb +3 -1
- data/test/rails_app/db/schema.rb +0 -1
- data/test/test_helper.rb +9 -6
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 581626c86185aaf6f5155ff71279a5bddc26beac617d894523b97ea534960f08
|
4
|
+
data.tar.gz: 93b3a57bcde0653c6682e0757137e4f5612e6e4f3444dd4fe94d556ec5ef77a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e9eb3bd1494b2cca18f2b61adc0bc62794cff238afb6c7713826aaea44f4987648520d735ffd93f2e81b2bd69dc7ac7adc5d0966fda75d3ebdc728ed6c5c476
|
7
|
+
data.tar.gz: 442a77045473b79c8a4bdeb82e3002f63c3eb1195cc321754ae8ebc905c02d0300c58eb5c95f8488e58b27fb33a7c7ca5a536b99da305a30470b32e2e788a6ef
|
@@ -0,0 +1,10 @@
|
|
1
|
+
name: Check Changelog
|
2
|
+
on: [pull_request]
|
3
|
+
jobs:
|
4
|
+
build:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
steps:
|
7
|
+
- uses: actions/checkout@v1
|
8
|
+
- name: Check that CHANGELOG is touched
|
9
|
+
run: |
|
10
|
+
cat $GITHUB_EVENT_PATH | jq .pull_request.title | grep -i '\[\(\(changelog skip\)\|\(ci skip\)\)\]' || git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -443,9 +443,6 @@ When the test is done it will output which commit "won" and by how much:
|
|
443
443
|
1.0870x [older/newer]
|
444
444
|
8.0026% [(older - newer) / older * 100]
|
445
445
|
[13d6aa3a7b] "Merge pull request #36284 from kamipo/fix_eager_loading_with_string_joins" - (11.9255485 seconds)
|
446
|
-
|
447
|
-
P-value: 4.635595463712749e-05
|
448
|
-
Is significant? (P-value < 0.05): true
|
449
446
|
```
|
450
447
|
|
451
448
|
You can provide this to the Rails team along with the example app you used to benchmark (so they can independently verify if needed).
|
data/derailed_benchmarks.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |gem|
|
|
27
27
|
gem.add_dependency "get_process_mem", "~> 0"
|
28
28
|
gem.add_dependency "benchmark-ips", "~> 2"
|
29
29
|
gem.add_dependency "rack", ">= 1"
|
30
|
-
gem.add_dependency "rake", "> 10", "<
|
30
|
+
gem.add_dependency "rake", "> 10", "< 14"
|
31
31
|
gem.add_dependency "thor", "~> 0.19"
|
32
32
|
gem.add_dependency "ruby-statistics", ">= 2.1"
|
33
33
|
|
data/gemfiles/rails_6_0.gemfile
CHANGED
@@ -77,6 +77,14 @@ Kernel.define_singleton_method(:require) do |file|
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
+
class Object
|
81
|
+
private
|
82
|
+
|
83
|
+
def require(path)
|
84
|
+
Kernel.require(path)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
80
88
|
# Don't forget to assign a cost to the top level
|
81
89
|
cost_before_requiring_anything = GetProcessMem.new.mb
|
82
90
|
TOP_REQUIRE.cost = cost_before_requiring_anything
|
@@ -42,16 +42,14 @@ module DerailedBenchmarks
|
|
42
42
|
|
43
43
|
def call
|
44
44
|
@files.each(&:call)
|
45
|
-
@stats =
|
45
|
+
@stats = statistical_test
|
46
46
|
self
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
50
|
-
StatisticalTest::
|
51
|
-
|
52
|
-
:
|
53
|
-
series_1,
|
54
|
-
series_2
|
49
|
+
def statistical_test(series_1=oldest.values, series_2=newest.values)
|
50
|
+
StatisticalTest::KSTest.two_samples(
|
51
|
+
group_one: series_1,
|
52
|
+
group_two: series_2
|
55
53
|
)
|
56
54
|
end
|
57
55
|
|
@@ -59,8 +57,12 @@ module DerailedBenchmarks
|
|
59
57
|
@stats[:alternative]
|
60
58
|
end
|
61
59
|
|
62
|
-
def
|
63
|
-
@stats[:
|
60
|
+
def d_max
|
61
|
+
@stats[:d_max].to_f
|
62
|
+
end
|
63
|
+
|
64
|
+
def d_critical
|
65
|
+
@stats[:d_critical].to_f
|
64
66
|
end
|
65
67
|
|
66
68
|
def x_faster
|
@@ -91,8 +93,11 @@ module DerailedBenchmarks
|
|
91
93
|
io.puts
|
92
94
|
io.puts "Iterations per sample: #{ENV["TEST_COUNT"]}"
|
93
95
|
io.puts "Samples: #{newest.values.length}"
|
94
|
-
io.puts
|
95
|
-
io.puts "
|
96
|
+
io.puts
|
97
|
+
io.puts "Test type: Kolmogorov Smirnov"
|
98
|
+
io.puts "Is significant? (max > critical): #{significant?}"
|
99
|
+
io.puts "D critical: #{d_critical}"
|
100
|
+
io.puts "D max: #{d_max}"
|
96
101
|
io.puts
|
97
102
|
end
|
98
103
|
end
|
@@ -53,7 +53,7 @@ namespace :perf do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
stats = DerailedBenchmarks::StatsFromDir.new(branch_info)
|
56
|
-
ENV["DERAILED_STOP_VALID_COUNT"] ||= "
|
56
|
+
ENV["DERAILED_STOP_VALID_COUNT"] ||= "50"
|
57
57
|
stop_valid_count = Integer(ENV["DERAILED_STOP_VALID_COUNT"])
|
58
58
|
|
59
59
|
times_significant = 0
|
@@ -18,8 +18,8 @@ class StatsFromDirTest < ActiveSupport::TestCase
|
|
18
18
|
assert_equal "winner", newest.name
|
19
19
|
assert_equal "loser", oldest.name
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
assert_in_delta 0.26, stats.d_max, 0.01
|
22
|
+
assert_in_delta 0.1730818382602285, stats.d_critical, 0.00001
|
23
23
|
assert_equal true, stats.significant?
|
24
24
|
|
25
25
|
assert_equal "1.0062", stats.x_faster
|
@@ -36,8 +36,12 @@ class StatsFromDirTest < ActiveSupport::TestCase
|
|
36
36
|
oldest = stats.oldest
|
37
37
|
|
38
38
|
# Test fixture for banner
|
39
|
-
def stats.
|
40
|
-
"0.
|
39
|
+
def stats.d_max
|
40
|
+
"0.037"
|
41
|
+
end
|
42
|
+
|
43
|
+
def stats.d_critical
|
44
|
+
"0.001"
|
41
45
|
end
|
42
46
|
|
43
47
|
def newest.average
|
@@ -95,7 +99,7 @@ EOM
|
|
95
99
|
|
96
100
|
test "stats from samples with slightly different sizes" do
|
97
101
|
stats = DerailedBenchmarks::StatsFromDir.new({})
|
98
|
-
out = stats.
|
102
|
+
out = stats.statistical_test([100,101,102, 100, 101, 99], [1,3, 3, 2])
|
99
103
|
assert out[:alternative]
|
100
104
|
end
|
101
105
|
end
|
@@ -4,6 +4,8 @@
|
|
4
4
|
require File.expand_path('../application', __FILE__)
|
5
5
|
|
6
6
|
# Initialize the rails application
|
7
|
-
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer
|
7
|
+
if Rails.application.config.active_record.sqlite3.respond_to?(:represent_boolean_as_integer)
|
8
|
+
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
|
9
|
+
end
|
8
10
|
|
9
11
|
Dummy::Application.initialize!
|
data/test/rails_app/db/schema.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -29,16 +29,19 @@ Capybara.default_driver = :rack_test
|
|
29
29
|
Capybara.default_selector = :css
|
30
30
|
|
31
31
|
require_relative "rails_app/config/environment"
|
32
|
-
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../rails_app/db/migrate", __dir__)]
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
# https://github.com/plataformatec/devise/blob/master/test/orm/active_record.rb
|
34
|
+
migrate_path = File.expand_path("../rails_app/db/migrate", __FILE__)
|
35
|
+
if Rails.version.start_with? '6'
|
36
|
+
ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate
|
37
|
+
elsif Rails.version.start_with? '5.2'
|
38
|
+
ActiveRecord::MigrationContext.new(migrate_path).migrate
|
38
39
|
else
|
39
|
-
ActiveRecord::Migrator.migrate(
|
40
|
+
ActiveRecord::Migrator.migrate(migrate_path)
|
40
41
|
end
|
41
42
|
|
43
|
+
ActiveRecord::Migration.maintain_test_schema!
|
44
|
+
|
42
45
|
# Load support files
|
43
46
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
44
47
|
|
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.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Schneeman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-03 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: '14'
|
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: '14'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: thor
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -218,6 +218,7 @@ executables:
|
|
218
218
|
extensions: []
|
219
219
|
extra_rdoc_files: []
|
220
220
|
files:
|
221
|
+
- ".github/workflows/check_changelog.yml"
|
221
222
|
- ".gitignore"
|
222
223
|
- ".travis.yml"
|
223
224
|
- Appraisals
|