[#84280] [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD — nobu@...
Issue #14181 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/12/15
[#84398] [Ruby trunk Bug#14220] WEBrick changes - failures on MSWIN, MinGW — Greg.mpls@...
Issue #14220 has been reported by MSP-Greg (Greg L).
3 messages
2017/12/22
[#84472] Re: [ruby-dev:50394] [Ruby trunk Bug#14240] warn four special variables: $; $, $/ $\ — Eric Wong <normalperson@...>
Shouldn't English posts be on ruby-core instead of ruby-dev?
3 messages
2017/12/26
[ruby-core:84305] [Ruby trunk Feature#14146] Improve performance of creating Hash object
From:
watson1978@...
Date:
2017-12-16 16:51:02 UTC
List:
ruby-core #84305
Issue #14146 has been updated by watson1978 (Shizuo Fujita).
> Any chances you tried --with-jemalloc ? It might perhaps exhibit something different.
I tried jemalloc at https://github.com/ruby/ruby/pull/1766#issuecomment-350553062
Just use jemalloc, I got a performance improvement 4.381M -> 7.071M (61.4% up) on macOS.
but, it is no difference for Ubuntu 17.10.
> Good. However, I think you should consider using ccan/list. It is field proven.
I updated a patch to use ccan/list at https://github.com/ruby/ruby/pull/1766/commits/f0189dae115cee3fa3dbb5eadb7332f2d082be5c
----------------------------------------
Feature #14146: Improve performance of creating Hash object
https://bugs.ruby-lang.org/issues/14146#change-68463
* Author: watson1978 (Shizuo Fujita)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
When generate Hash object, the heap area of st_table will be always allocated in internally
and seems it take a time.
To improve performance of creating Hash object,
this patch will reduce count of allocating heap areas for st_table by reuse them.
Performance of creating Hash literal -> 1.53 times faster.
### Before
```
$ ./miniruby -v -I. -I../benchmark-ips/lib ~/tmp/bench/literal.rb
ruby 2.5.0dev (2017-11-28 hash 60926) [x86_64-darwin17]
Warming up --------------------------------------
Hash literal 51.544k i/100ms
Calculating -------------------------------------
Hash literal 869.132k (賊 1.1%) i/s - 4.381M in 5.041574s
```
### After
```
$ ./miniruby -v -I. -I../benchmark-ips/lib ~/tmp/bench/literal.rb
ruby 2.5.0dev (2017-11-28 hash 60926) [x86_64-darwin17]
Warming up --------------------------------------
Hash literal 63.068k i/100ms
Calculating -------------------------------------
Hash literal 1.328M (賊 2.3%) i/s - 6.685M in 5.037861s
```
### Test code
```
require 'benchmark/ips'
Benchmark.ips do |x|
x.report "Hash literal" do |loop|
count = 0
while count < loop
hash = {foo: 12, bar: 34, baz: 56}
count += 1
end
end
end
```
### Patch
https://github.com/ruby/ruby/pull/1766
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>