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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cefb45902f24e4e4b0d8083b59ad9733005943db3df8a8b97b30552a27ff400b
4
- data.tar.gz: 9d5921ac19df4db40e78ec2ca6396593f1f5235c3caaae84c332163ed3c5e4ec
3
+ metadata.gz: 581626c86185aaf6f5155ff71279a5bddc26beac617d894523b97ea534960f08
4
+ data.tar.gz: 93b3a57bcde0653c6682e0757137e4f5612e6e4f3444dd4fe94d556ec5ef77a8
5
5
  SHA512:
6
- metadata.gz: 3335a72cc6b965b76f6804c3dd71ae5cf61d56f5203447870f0ad31a30c6cef5c47b28cf569311d7c033fe2898f2653ab041d7c7dceefe85e5501c4b79ab06b4
7
- data.tar.gz: f591582236f863286b65d9a96b33b481e0a2c9cb05a6985ecb4123d121452ebda81a1b5d123f1d0a77c297939e8f6f2de16ca14dad892436109d819ff2b7ee91
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
@@ -1,5 +1,9 @@
1
1
  # A Log of Changes!
2
2
 
3
+ ## 1.4.1
4
+
5
+ - Rake dependency now allows for Rake 13 (https://github.com/schneems/derailed_benchmarks/pull/151)
6
+
3
7
  ## 1.4.0
4
8
 
5
9
  - Allow configuration of `perf:ips` benchmark.
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).
@@ -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", "< 13"
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
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  source "https://rubygems.org"
6
6
 
7
- gem "rails", "6.0.0.rc1"
7
+ gem "rails", "6.0.0"
8
8
 
9
9
  group :development, :test do
10
10
  gem "sqlite3", platform: [:ruby, :mswin, :mingw]
@@ -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 = students_t_test
45
+ @stats = statistical_test
46
46
  self
47
47
  end
48
48
 
49
- def students_t_test(series_1=oldest.values, series_2=newest.values)
50
- StatisticalTest::TTest.perform(
51
- alpha = 0.05,
52
- :two_tail,
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 p_value
63
- @stats[:p_value].to_f
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 "P-value: #{p_value}"
95
- io.puts "Is significant? (P-value < 0.05): #{significant?}"
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"] ||= "10"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DerailedBenchmarks
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.1"
5
5
  end
@@ -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
- assert 3.6e-05 < stats.p_value
22
- assert 3.8e-05 > stats.p_value
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.p_value
40
- "0.000037"
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.students_t_test([100,101,102], [1,3])
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 = true
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!
@@ -32,5 +32,4 @@ ActiveRecord::Schema.define(version: 20141210070547) do
32
32
 
33
33
  add_index "users", ["email"], name: "index_users_on_email", unique: true
34
34
  add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
35
-
36
35
  end
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
- if Rails.gem_version >= Gem::Version.new('5.2.0')
35
- ActiveRecord::MigrationContext
36
- .new(File.expand_path("../rails_app/db/migrate/", __FILE__))
37
- .migrate
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(File.expand_path("../rails_app/db/migrate/", __FILE__))
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.0
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-09-25 00:00:00.000000000 Z
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: '13'
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: '13'
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