Age | Commit message (Collapse) | Author |
|
|
|
This drops the total size of a Time object from 86 bytes to 80 bytes.
Running the benchmark benchmark/time_now.yml, this commit improves
performance of Time.now by about 30%:
```
Time.now
Branch: 13159405.4 i/s
Master: 10036908.7 i/s - 1.31x slower
Time.now(in: "+09:00")
Branch: 2712172.6 i/s
Master: 2138637.9 i/s - 1.27x slower
```
It also decreases memory usage by about 20%:
```
ary = 10_000_000.times.map { Time.now }
puts `ps -o rss= -p #{$$}`
```
Branch: 961792
Master: 1196544
Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
|
|
assert_separately adds --disable=gems so we don't need to add
--disable-gems when calling assert_separately.
Notes:
Merged: https://github.com/ruby/ruby/pull/8162
|
|
Disallow:
* Only year-month
* Only year-month-day
* Preceding whitespace
* Trailing whitespace
Fixes [Bug #19293]
Notes:
Merged: https://github.com/ruby/ruby/pull/7974
|
|
[Bug #19575]
struct vtm is packed causing it to have a size that is not aligned on
32-bit systems. When allocating it on the stack, it will have unaligned
addresses which means that the fields won't be marked by the GC when
scanning the stack (since the GC only marks aligned addresses). This can
cause crashes when the fields are heap allocated objects like Bignums.
This commit moves the flags in struct time_object into struct vtm for
space efficiency and removes the need for packing.
This is an example of a crash:
ruby(rb_print_backtrace+0xd) [0x56848945] ../src/vm_dump.c:785
ruby(rb_vm_bugreport) ../src/vm_dump.c:1101
ruby(rb_assert_failure+0x7a) [0x56671857] ../src/error.c:878
ruby(vm_search_cc+0x0) [0x56666e47] ../src/vm_method.c:1366
ruby(rb_vm_search_method_slowpath) ../src/vm_insnhelper.c:2090
ruby(callable_method_entry+0x5) [0x568232d3] ../src/vm_method.c:1406
ruby(rb_callable_method_entry) ../src/vm_method.c:1413
ruby(gccct_method_search_slowpath) ../src/vm_eval.c:427
ruby(gccct_method_search+0x20f) [0x568237ef] ../src/vm_eval.c:476
ruby(opt_equality_by_mid_slowpath+0x2c) [0x5682388c] ../src/vm_insnhelper.c:2338
ruby(rb_equal+0x37) [0x566fe577] ../src/object.c:133
ruby(rb_big_eq+0x34) [0x56876ee4] ../src/bignum.c:5554
ruby(rb_int_equal+0x14) [0x566f3ed4] ../src/numeric.c:4640
ruby(rb_int_equal) ../src/numeric.c:4634
ruby(vm_call0_cfunc_with_frame+0x6d) [0x568303c2] ../src/vm_eval.c:148
ruby(vm_call0_cfunc) ../src/vm_eval.c:162
ruby(vm_call0_body) ../src/vm_eval.c:208
ruby(rb_funcallv_scope+0xd1) [0x56833971] ../src/vm_eval.c:85
ruby(RB_TEST+0x0) [0x567e8488] ../src/time.c:78
ruby(eq) ../src/time.c:78
ruby(small_vtm_sub) ../src/time.c:1523
ruby(timelocalw+0x23b) [0x567f3e9b] ../src/time.c:1593
ruby(time_s_alloc+0x0) [0x567f536b] ../src/time.c:3698
ruby(time_new_timew) ../src/time.c:2694
ruby(time_s_mktime) ../src/time.c:3698
Notes:
Merged: https://github.com/ruby/ruby/pull/7650
|
|
[Bug #19390]
We shouldn't check the string length when skipping zeros, as the
string might only contains zero characters, resulting in an empty string.
Notes:
Merged: https://github.com/ruby/ruby/pull/7196
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7051
|
|
* 4-digits or more is required as year
* Minutes and seconds parts are not ommittable
Notes:
Merged: https://github.com/ruby/ruby/pull/4825
|
|
Which limits the precision of subsecond. Defaulted to 9, that
means nanosecond.
Notes:
Merged: https://github.com/ruby/ruby/pull/4825
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4825
|
|
`Time.new` now parses strings such as the result of `Time#inspect`
and restricted ISO-8601 formats.
Notes:
Merged: https://github.com/ruby/ruby/pull/4825
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6594
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6146
Merged-By: nobu <nobu@ruby-lang.org>
|
|
Add a new macro BASE_SLOT_SIZE that determines the slot size.
For Variable Width Allocation (compiled with USE_RVARGC=1), all slot
sizes are powers-of-2 multiples of BASE_SLOT_SIZE.
For USE_RVARGC=0, BASE_SLOT_SIZE is set to sizeof(RVALUE).
Notes:
Merged: https://github.com/ruby/ruby/pull/5517
|
|
|
|
https://bugs.ruby-lang.org/issues/17485#change-89871
Notes:
Merged: https://github.com/ruby/ruby/pull/5344
|
|
https://hackerone.com/reports/1244185
Notes:
Merged: https://github.com/ruby/ruby/pull/5238
|
|
|
|
`vm_ci_argc` gives the number of arguments, but `*[1, 2, 3]` only
counts for one.
Notes:
Merged: https://github.com/ruby/ruby/pull/5124
|
|
Remove tests that assume objects get force recycled.
Notes:
Merged: https://github.com/ruby/ruby/pull/5096
|
|
`struct vtm::year` is a Ruby integer instance, but not a C integer
type.
Notes:
Merged: https://github.com/ruby/ruby/pull/5041
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4813
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4813
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4075
|
|
In RFC 3339, -00:00 is used for the time in UTC is known, but the
offset to local time is unknown. Support that representation by
`-` flag for `z`.
Notes:
Merged: https://github.com/ruby/ruby/pull/4075
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4020
|
|
https://bugs.ruby-lang.org/issues/17485#change-89871
|
|
|
|
|
|
follow up to 9908177857a28633d6279c43a1ad4dfedcb98596
|
|
Instead of suppressing all warnings wholly in each test scripts by
setting `$VERBOSE` to `nil` in `setup` methods.
Notes:
Merged: https://github.com/ruby/ruby/pull/3925
Merged-By: nobu <nobu@ruby-lang.org>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3841
|
|
Fixes [Bug #17025]
Notes:
Merged: https://github.com/ruby/ruby/pull/3362
|
|
|
|
GC_DEBUG=1 makes this test fail because it changes the size of struct
RVALUE. I don't think the test is useful then. Let's just skip.
|
|
ruby/test_time_tz.rb (not sure only this file affects) changes TZ
and it seems to change internal state. This internal state change
fails test_2038 and test_timegm on 2nd time execution.
At this time I have no idea how to fix this issue, so I skips these
tests on 2nd trial.
You can try this failure with the following command without this patch.
$ make test-all TESTS='--repeat-count=2 ruby/require ruby/time ruby/time_tz'
|
|
If this value is less than zero, then the mask check is guaranteed to
fail as well, so we might as well rely on that.
Notes:
Merged: https://github.com/ruby/ruby/pull/2808
|
|
Suggestion from Laurence Parry.
Fixes [Bug #16030]
Notes:
Merged: https://github.com/ruby/ruby/pull/2572
|
|
|
|
|
|
[Feature #15160]
|
|
Closes: https://github.com/ruby/ruby/pull/2133
|
|
[Feature #15653]
[Fix GH-2092]
From: manga_osyo <manga.osyo@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* time.c (time_set_utc_offset): reset zone when setting to fixoff
mode. while previously TZMODE_SET_FIXOFF has reset it always,
the zone is kept for loaded zone since r65025.
[ruby-core:90627] [Bug #15439]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Especially over the year 2038, 30 Feb and so on may cause odd behavior
on validating found epoch with given year-month-day [Bug #15340]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* hash.c, internal.h: support theap for small Hash.
Introduce RHASH_ARRAY (li_table) besides st_table and small Hash
(<=8 entries) are managed by an array data structure.
This array data can be managed by theap.
If st_table is needed, then converting array data to st_table data.
For st_table using code, we prepare "stlike" APIs which accepts hash value
and are very similar to st_ APIs.
This work is based on the GSoC achievement
by tacinight <tacingiht@gmail.com> and refined by ko1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Any single object allocation can reduce object count, and
object counts are global, so multi-threading leads to unpredictable
results.
See also similar commits: r60699 and r62608
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|