Update upstream source from tag 'upstream/12.1.14'

Update to upstream version '12.1.14'
with Debian dir 929e41dede
This commit is contained in:
Utkarsh Gupta 2019-10-07 21:29:15 +05:30
commit afc4fa9433
15 changed files with 68 additions and 32 deletions

View file

@ -2,6 +2,10 @@
documentation](doc/development/changelog.md) for instructions on adding your own documentation](doc/development/changelog.md) for instructions on adding your own
entry. entry.
## 12.1.14
- No changes.
## 12.1.13 ## 12.1.13
### Security (1 change) ### Security (1 change)

View file

@ -1 +1 @@
12.1.13 12.1.14

View file

@ -0,0 +1,10 @@
name: Check Changelog
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Check that CHANGELOG is touched
run: |
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

View file

@ -1,5 +1,9 @@
# A Log of Changes! # A Log of Changes!
## 1.4.1
- Rake dependency now allows for Rake 13 (https://github.com/schneems/derailed_benchmarks/pull/151)
## 1.4.0 ## 1.4.0
- Allow configuration of `perf:ips` benchmark. - Allow configuration of `perf:ips` benchmark.

View file

@ -443,9 +443,6 @@ When the test is done it will output which commit "won" and by how much:
1.0870x [older/newer] 1.0870x [older/newer]
8.0026% [(older - newer) / older * 100] 8.0026% [(older - newer) / older * 100]
[13d6aa3a7b] "Merge pull request #36284 from kamipo/fix_eager_loading_with_string_joins" - (11.9255485 seconds) [13d6aa3a7b] "Merge pull request #36284 from kamipo/fix_eager_loading_with_string_joins" - (11.9255485 seconds)
P-value: 4.635595463712749e-05
Is significant? (P-value < 0.05): true
``` ```
You can provide this to the Rails team along with the example app you used to benchmark (so they can independently verify if needed). You can provide this to the Rails team along with the example app you used to benchmark (so they can independently verify if needed).

View file

@ -27,7 +27,7 @@ Gem::Specification.new do |gem|
gem.add_dependency "get_process_mem", "~> 0" gem.add_dependency "get_process_mem", "~> 0"
gem.add_dependency "benchmark-ips", "~> 2" gem.add_dependency "benchmark-ips", "~> 2"
gem.add_dependency "rack", ">= 1" gem.add_dependency "rack", ">= 1"
gem.add_dependency "rake", "> 10", "< 13" gem.add_dependency "rake", "> 10", "< 14"
gem.add_dependency "thor", "~> 0.19" gem.add_dependency "thor", "~> 0.19"
gem.add_dependency "ruby-statistics", ">= 2.1" gem.add_dependency "ruby-statistics", ">= 2.1"

View file

@ -4,7 +4,7 @@
source "https://rubygems.org" source "https://rubygems.org"
gem "rails", "6.0.0.rc1" gem "rails", "6.0.0"
group :development, :test do group :development, :test do
gem "sqlite3", platform: [:ruby, :mswin, :mingw] gem "sqlite3", platform: [:ruby, :mswin, :mingw]

View file

@ -77,6 +77,14 @@ Kernel.define_singleton_method(:require) do |file|
end end
end end
class Object
private
def require(path)
Kernel.require(path)
end
end
# Don't forget to assign a cost to the top level # Don't forget to assign a cost to the top level
cost_before_requiring_anything = GetProcessMem.new.mb cost_before_requiring_anything = GetProcessMem.new.mb
TOP_REQUIRE.cost = cost_before_requiring_anything TOP_REQUIRE.cost = cost_before_requiring_anything

View file

@ -42,16 +42,14 @@ module DerailedBenchmarks
def call def call
@files.each(&:call) @files.each(&:call)
@stats = students_t_test @stats = statistical_test
self self
end end
def students_t_test(series_1=oldest.values, series_2=newest.values) def statistical_test(series_1=oldest.values, series_2=newest.values)
StatisticalTest::TTest.perform( StatisticalTest::KSTest.two_samples(
alpha = 0.05, group_one: series_1,
:two_tail, group_two: series_2
series_1,
series_2
) )
end end
@ -59,8 +57,12 @@ module DerailedBenchmarks
@stats[:alternative] @stats[:alternative]
end end
def p_value def d_max
@stats[:p_value].to_f @stats[:d_max].to_f
end
def d_critical
@stats[:d_critical].to_f
end end
def x_faster def x_faster
@ -91,8 +93,11 @@ module DerailedBenchmarks
io.puts io.puts
io.puts "Iterations per sample: #{ENV["TEST_COUNT"]}" io.puts "Iterations per sample: #{ENV["TEST_COUNT"]}"
io.puts "Samples: #{newest.values.length}" io.puts "Samples: #{newest.values.length}"
io.puts "P-value: #{p_value}" io.puts
io.puts "Is significant? (P-value < 0.05): #{significant?}" io.puts "Test type: Kolmogorov Smirnov"
io.puts "Is significant? (max > critical): #{significant?}"
io.puts "D critical: #{d_critical}"
io.puts "D max: #{d_max}"
io.puts io.puts
end end
end end

View file

@ -53,7 +53,7 @@ namespace :perf do
end end
stats = DerailedBenchmarks::StatsFromDir.new(branch_info) stats = DerailedBenchmarks::StatsFromDir.new(branch_info)
ENV["DERAILED_STOP_VALID_COUNT"] ||= "10" ENV["DERAILED_STOP_VALID_COUNT"] ||= "50"
stop_valid_count = Integer(ENV["DERAILED_STOP_VALID_COUNT"]) stop_valid_count = Integer(ENV["DERAILED_STOP_VALID_COUNT"])
times_significant = 0 times_significant = 0

View file

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module DerailedBenchmarks module DerailedBenchmarks
VERSION = "1.4.0" VERSION = "1.4.1"
end end

View file

@ -18,8 +18,8 @@ class StatsFromDirTest < ActiveSupport::TestCase
assert_equal "winner", newest.name assert_equal "winner", newest.name
assert_equal "loser", oldest.name assert_equal "loser", oldest.name
assert 3.6e-05 < stats.p_value assert_in_delta 0.26, stats.d_max, 0.01
assert 3.8e-05 > stats.p_value assert_in_delta 0.1730818382602285, stats.d_critical, 0.00001
assert_equal true, stats.significant? assert_equal true, stats.significant?
assert_equal "1.0062", stats.x_faster assert_equal "1.0062", stats.x_faster
@ -36,8 +36,12 @@ class StatsFromDirTest < ActiveSupport::TestCase
oldest = stats.oldest oldest = stats.oldest
# Test fixture for banner # Test fixture for banner
def stats.p_value def stats.d_max
"0.000037" "0.037"
end
def stats.d_critical
"0.001"
end end
def newest.average def newest.average
@ -95,7 +99,7 @@ EOM
test "stats from samples with slightly different sizes" do test "stats from samples with slightly different sizes" do
stats = DerailedBenchmarks::StatsFromDir.new({}) stats = DerailedBenchmarks::StatsFromDir.new({})
out = stats.students_t_test([100,101,102], [1,3]) out = stats.statistical_test([100,101,102, 100, 101, 99], [1,3, 3, 2])
assert out[:alternative] assert out[:alternative]
end end
end end

View file

@ -4,6 +4,8 @@
require File.expand_path('../application', __FILE__) require File.expand_path('../application', __FILE__)
# Initialize the rails application # Initialize the rails application
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true if Rails.application.config.active_record.sqlite3.respond_to?(:represent_boolean_as_integer)
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
end
Dummy::Application.initialize! Dummy::Application.initialize!

View file

@ -32,5 +32,4 @@ ActiveRecord::Schema.define(version: 20141210070547) do
add_index "users", ["email"], name: "index_users_on_email", unique: true add_index "users", ["email"], name: "index_users_on_email", unique: true
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end end

View file

@ -29,16 +29,19 @@ Capybara.default_driver = :rack_test
Capybara.default_selector = :css Capybara.default_selector = :css
require_relative "rails_app/config/environment" require_relative "rails_app/config/environment"
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../rails_app/db/migrate", __dir__)]
if Rails.gem_version >= Gem::Version.new('5.2.0') # https://github.com/plataformatec/devise/blob/master/test/orm/active_record.rb
ActiveRecord::MigrationContext migrate_path = File.expand_path("../rails_app/db/migrate", __FILE__)
.new(File.expand_path("../rails_app/db/migrate/", __FILE__)) if Rails.version.start_with? '6'
.migrate ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate
elsif Rails.version.start_with? '5.2'
ActiveRecord::MigrationContext.new(migrate_path).migrate
else else
ActiveRecord::Migrator.migrate(File.expand_path("../rails_app/db/migrate/", __FILE__)) ActiveRecord::Migrator.migrate(migrate_path)
end end
ActiveRecord::Migration.maintain_test_schema!
# Load support files # Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }