Граф коммитов

46972 Коммитов

Автор SHA1 Сообщение Дата
naruse 58d8d65281 Solaris 10 x86 raseis SEGV
http://rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20170527T221806Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 06:50:35 +00:00
duerst 11954049fa Change max byte length of UTF-8 to 4 bytes
In enc/utf_8.c, change maximum byte length of UTF-8 to 4 bytes (from 6)
to conform to definition of UTF-8. This closes issue #13590.
(This is a retry of r58954, after issue #13590 has been addressed.)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 05:43:41 +00:00
watson1978 ab3a40c103 Improve performance of Range#{min,max}
range.c (range_min): use OPTIMIZED_CMP() to compare the objects instead of
    `<=>' method dispatching for Fixnum/Float/String object inside Range object.

range.c (range_max): ditto.

    Range#min -> 34 % up
    Range#max -> 44 % up

    [ruby-core:80713] [Bug #13443] [Fix GH-1585]

### Before
           Range#min      8.428M (± 1.3%) i/s -     42.141M in   5.000952s
           Range#max      8.157M (± 1.3%) i/s -     40.852M in   5.009297s

### After
           Range#min     11.269M (± 1.2%) i/s -     56.388M in   5.004611s
           Range#max     11.764M (± 1.3%) i/s -     58.856M in   5.003820s

### Test code
require 'benchmark/ips'

Benchmark.ips do |x|
  x.report "Range#min" do |i|
    i.times { (1..100).min }
  end

  x.report "Range#max" do |i|
    i.times { (1..100).max }
  end
end

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 02:57:33 +00:00
svn afa0e3c972 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 17:56:47 +00:00
eregon f35c3a5498 Clean up a bit the Process.setpriority specs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 17:56:46 +00:00
eregon a578c375ad Enable Process.setpriority for a single process on more platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 17:56:34 +00:00
svn ab86387a35 * 2017-05-30
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 15:34:46 +00:00
nobu eee4dee0a2 Run in separate process/pgrp [Bug #13609]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 15:34:45 +00:00
eregon 01ebc04fa2 Simplify, avoid extra exceptions and add test for concurrent mspec mkdir_p
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 11:19:42 +00:00
k0kubun fc7241ffe2 rubyspec: Fix method redefinition warning
ruby/spec/rubyspec/library/erb/run_spec.rb:63: warning: method redefined; discarding old main
ruby/spec/rubyspec/library/erb/result_spec.rb:53: warning: previous definition of main was here
ruby/spec/rubyspec/library/erb/run_spec.rb:76: warning: method redefined; discarding old main1
ruby/spec/rubyspec/library/erb/result_spec.rb:67: warning: previous definition of main1 was here
ruby/spec/rubyspec/library/erb/run_spec.rb:81: warning: method redefined; discarding old main2
ruby/spec/rubyspec/library/erb/result_spec.rb:72: warning: previous definition of main2 was here

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 10:53:54 +00:00
k0kubun 26e32b7d65 test/erb/test_erb.rb: Fix unused variable warning
ruby/test/erb/test_erb.rb:575: warning: assigned but unused variable - foo

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 10:22:47 +00:00
duerst e07bff3ce3 revert r58954 temporarily
Revert change to maximum of 4 bytes for UTF-8 characters at r58954 temporarily.
This failed spec at https://travis-ci.org/ruby/ruby/builds/237086017, but it
is totally unclear why.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 08:59:41 +00:00
duerst a03690ae73 Change max byte length of UTF-8 to 4 bytes
In enc/utf_8.c, change maximum byte length of UTF-8 to 4 bytes (from 6)
to conform to definition of UTF-8. This closes issue #13590.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 08:41:23 +00:00
nobu 83ddb7c182 fix up r58952
* spec/mspec/lib/mspec/helpers/fs.rb (Object#mkdir_p): rescue
  File.stat when the target does not exist.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 07:03:11 +00:00
nobu e0b0b923c6 fix race condition
* spec/mspec/lib/mspec/helpers/fs.rb (Object#mkdir_p): fix race
  condition when multi_exec.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 06:53:05 +00:00
nobu 5689f7c7e4 tool/runruby.rb: exec ruby-runner
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 06:39:42 +00:00
nobu d4408a3d8b ruby-runner.c: replace argv[0]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 06:39:41 +00:00
nobu f8fbb8bc11 default.mspec: remove useless flags
* spec/default.mspec: removed -I options for useless or non-
  existent paths from flags.  there is no library scripts and .ext
  directory in the source directory.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 05:19:51 +00:00
naruse abbfc048c5 suppress warning: ambiguous first argument; put parentheses or a space even after `-' operator
Introduced at r58905
http://rubyci.s3.amazonaws.com/ubuntu/ruby-trunk/log/20170526T153003Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:41:31 +00:00
naruse dd0148007f Revert "Update to ruby/spec@2a047c8"
This reverts commit 2531a1013b.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:40:12 +00:00
svn 5fcbdd3d9e * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:29:05 +00:00
svn 8847d0b6ad * 2017-05-29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:29:05 +00:00
naruse 0f9fa1ddab Revert r58939 and r58942
This reverts following commits because it breaks mswinci
* Update to ruby/spec@2a047c8
* Update to ruby/spec@ca32ae2

see also the result:
http://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20170528T140014Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:29:04 +00:00
nobu 1245a4a4fb lldb_cruby.py: constants from the target
* misc/lldb_cruby.py (lldb_init): get constants from
  ruby_dummy_gdb_enums in the target.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 14:17:25 +00:00
eregon 75adc77e7c Update to ruby/spec@ca32ae2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 12:02:08 +00:00
svn 135ed12ea6 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 11:30:57 +00:00
eregon 4c1403c3e7 Add tool to pull latest mspec/spec when commits have been synchronized
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 11:30:55 +00:00
eregon 2531a1013b Update to ruby/spec@2a047c8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 11:30:42 +00:00
nobu ab55cd9fb5 ruby.c: file in load_file argument
* ruby.c (load_file): move opened file to an argument, to reduce
  open/close calls in the near future.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 09:49:30 +00:00
nobu 3ade78fff6 ruby.c: shrink ruby_cmdline_options_t
* ruby.c (ruby_cmdline_options_t): reordered members and turned
  simple flags into bit fields to reduce the size (136->104 on
  LP64).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 09:49:29 +00:00
normal a028cfc597 test/ruby/test_io.rb: adjust CPU usage check to 10%
I miscalculated for r58934, since we sleep 100ms, and
the worst possible case is 100 Hz in the kernel meaning
we only have 10ms resolution.  So, we need to increase
our CPU percentage to >= 10% for this.

This should be more than enough for our CI machines which
have 300 Hz kernels [ruby-core:81429]:

 http://ci.rvm.jp/results/trunk-test@sasada-8core/1495942555

* test/ruby/test_io.rb (test_copy_stream_no_busy_wait):
  override default percentage

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 05:39:29 +00:00
k0kubun 253232c028 process.c: Use getrusage(2) in Process.times
if getrusage(2) is available, to improve precision of Process.times and
its user like lib/benchmark.rb.

On macOS, since getrusage(2) has better precision than times(3),
they are much improved like:

* Before

Process.times
=> #<struct Process::Tms utime=0.56, stime=0.35, cutime=0.04, cstime=0.03>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.340000   0.310000   0.650000 (  0.674025)

* After

Process.times
=> #<struct Process::Tms utime=0.561899, stime=0.35076, cutime=0.046483, cstime=0.038929>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.343223   0.310037   0.653260 (  0.674025)

On Linux, since struct rusage from getrusage(2) is used instead of struct tms
from times(2), they are slightly improved like:

* Before

Process.times
=> #<struct Process::Tms utime=0.43, stime=0.11, cutime=0.0, cstime=0.0>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.120000   0.040000   0.170000 (  0.171621)

* After

Process.times
=> #<struct Process::Tms utime=0.432, stime=0.116, cutime=0.0, cstime=0.0>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.124000   0.048000   0.172000 (  0.171621)

[ruby-dev:49471] [Feature #11952]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 01:48:11 +00:00
normal 109ccfdb2c tests: increase CPU percentage threshold for assert_cpu_usage_low
When sleeping for the tick rate of 100ms (defined in
thread_pthread.c) as we do in test/ruby/test_io.rb
(test_copy_stream_no_busy_wait), it may not be possible to
measure with <= 10ms resolution on 100HZ systems (CONFIG_HZ in
the Linux kernel).  So increase the threshold to 15ms (10ms +
5ms slack for slow systems).

* test/lib/test/unit/assertions.rb (assert_cpu_usage_low):
  increase pct default value [ruby-core:81427]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 01:43:38 +00:00
svn ddf2a1675d * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 21:55:03 +00:00
svn 33319b8833 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 21:55:03 +00:00
eregon ead4095935 Update to ruby/spec@2795010
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 21:55:02 +00:00
eregon 24db428785 Update to ruby/mspec@6c95759
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 21:54:38 +00:00
svn d97c171b90 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 17:04:32 +00:00
svn 67ffb0dcb6 * 2017-05-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 17:04:32 +00:00
naruse 4d177a1f40 Initial commit of LLDB port of debug utility
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 17:04:31 +00:00
k0kubun 1d9030a107 bootstraptest/test_insns.rb: Fix typo
on test message. "torexp" insn does not exist.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 13:54:09 +00:00
normal b3d126d5de rb_wait_for_single_fd: do not OOM or segfault with invalid FD on select()
Instead, match the poll() implementation used on Linux for now;
as the Linux poll(2) manpage describes using negative FD to
easily ignore an FD in a larger FD set while (sleeping the given
timeout).  I'm not entirely sure if matching poll() behavior
is a good idea for a single FD, but it's better than segfaulting
or NoMemoryError.

* thread.c (init_set_fd): ignore negative FD
* test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb
  (test_wait_for_invalid_fd): check values which may trigger
  segfaults or OOM

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 08:26:47 +00:00
normal 71dca4b60d test for IO.copy_stream CPU usage (r58534)
I'm likely to make similar mistakes in the future when working
on Fiber auto-scheduling.  Start adding assertions for existing
code, first.

* test/ruby/test_io.rb (test_copy_stream_no_busy_wait): added
* test/lib/test/unit/assertions.rb (assert_cpu_usage_low): added

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 07:23:02 +00:00
normal 85fe3defcc Revert "common: "test-all" depends on "exts" target"
This reverts r58919.
Apparently skipping exts is intentional since r58759

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 07:18:52 +00:00
watson1978 b0accd9b13 Improve performance of some Time & Rational methods
rational.c (i_gcd): replace GCD algorithm from Euclidean algorithm to Stein
    algorithm (https://en.wikipedia.org/wiki/Binary_GCD_algorithm).

    Some Time methods will call internal quov() function and it calls
    Rational#quo -> f_muldiv() -> i_gcd() in rational.c
    And some Rational methods also call i_gcd().

    The implementation of Euclidean algorithm spent a long time at modulo
    operation (ie "x = y % x;").
    The Stein algorithm will replace with shift operation which is faster
    than modulo.

    Time#subsec -> 36 % up
    Time#to_r   -> 26 % up
    Rational#+  -> 14 % up
    Rational#-  -> 15 % up
    Rational#*  -> 13 % up

    [ruby-core:80843] [Bug #13503] [Fix GH-1596]

### Before
         Time#subsec      2.142M (± 9.8%) i/s -     10.659M in   5.022659s
           Time#to_r      2.003M (± 9.1%) i/s -      9.959M in   5.012445s
          Rational#+      3.843M (± 0.9%) i/s -     19.274M in   5.016254s
          Rational#-      3.820M (± 1.3%) i/s -     19.149M in   5.014137s
          Rational#*      5.198M (± 1.4%) i/s -     26.016M in   5.005664s
* After
         Time#subsec      2.902M (± 2.9%) i/s -     14.505M in   5.001815s
           Time#to_r      2.503M (± 4.8%) i/s -     12.512M in   5.011454s
          Rational#+      4.390M (± 1.2%) i/s -     22.001M in   5.012413s
          Rational#-      4.391M (± 1.2%) i/s -     22.013M in   5.014584s
          Rational#*      5.872M (± 2.2%) i/s -     29.369M in   5.003666s

* Test code
require 'benchmark/ips'

Benchmark.ips do |x|
  x.report "Time#subsec" do |t|
    time = Time.now
    t.times { time.subsec }
  end

  x.report "Time#to_r" do |t|
    time = Time.now
    t.times { time.to_r }
  end

  x.report "Rational#+" do |t|
    rat1 = 1/2r
    rat2 = 1/3r
    t.times { rat1 + rat2 }
  end

  x.report "Rational#-" do |t|
    rat1 = 1/3r
    rat2 = 1/2r
    t.times { rat1 - rat2 }
  end

  x.report "Rational#*" do |t|
    rat1 = 1/3r
    rat2 = 1/2r
    t.times { rat1 * rat2 }
  end
end

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 05:41:02 +00:00
watson1978 6fcb76ed80 Improve performance of some Time methods
internal.h : add rb_numeric_quo() as internal API.
rational.c : rename numeric_quo() to rb_numeric_quo() as internal API.
time.c (quov): optimize by invoking rb_numeric_quo() to retrieve a value of
    Numeric#quo instead of method dispatching via rb_funcall().

    Time#subsec ->  7 % up
    Time#-      -> 26 % up
    Time#to_f   -> 30 % up
    Time#to_r   ->  7 % up

    [ruby-core:80915] [Bug #13519] [Fix GH-1601]

### Before
         Time#subsec      2.024M (± 8.7%) i/s -     10.062M in   5.009762s
              Time#-      5.049M (± 4.7%) i/s -     25.186M in   5.002379s
           Time#to_f      5.625M (± 4.2%) i/s -     28.066M in   5.000749s
           Time#to_r      1.880M (± 9.7%) i/s -      9.361M in   5.027527s

### After
         Time#subsec      2.155M (± 9.7%) i/s -     10.724M in   5.022579s
              Time#-      6.362M (± 2.0%) i/s -     31.824M in   5.004625s
           Time#to_f      7.287M (± 4.8%) i/s -     36.402M in   5.010983s
           Time#to_r      2.020M (± 9.4%) i/s -     10.059M in   5.021852s

### Test code
require 'benchmark/ips'

Benchmark.ips do |x|
  x.report "Time#subsec" do |t|
    time = Time.now
    t.times { time.subsec }
  end

  x.report "Time#-" do |t|
    time1 = Time.now
    time2 = Time.now
    t.times { time1 - time2 }
  end

  x.report "Time#to_f" do |t|
    time = Time.now
    t.times { time.to_f }
  end

  x.report "Time#to_r" do |t|
    time = Time.now
    t.times { time.to_r }
  end
end

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 05:41:00 +00:00
nobu e7ff862257 .travis.yml: exts is not needed for tests here
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 05:18:52 +00:00
normal f9afb444fe common: "test-all" depends on "exts" target
This allows me to test changes to ext/ more easily by only typing:

  make test-all TESTS=/path/to/ext/test_foo.rb

I spent a few minutes wondering what was wrong before I realized
changes to exts were not taking effect.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 04:35:41 +00:00
nobu 8e81b3c766 mspec/commands/mspec.rb: formatter for multi_exec
* spec/mspec/lib/mspec/commands/mspec.rb (MSpecMain#multi_exec):
  as multi_exec children must run with yaml formatter, append the
  option for it after other options to override another formatter
  option with a warning if it is given.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 03:43:02 +00:00
nobu 944c8f400c .travis.yml: get number of processors at runtime
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 03:14:04 +00:00