[#80974] [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit — ko1@...
Issue #13517 has been updated by ko1 (Koichi Sasada).
4 messages
2017/05/02
[#81024] Re: [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit
— SASADA Koichi <ko1@...>
2017/05/07
sorry for late response.
[#80996] [Ruby trunk Feature#13544] Allow loading an ISeqs sequence directly from a C extension without requiring buffer is in an RVALUE — sam.saffron@...
Issue #13544 has been reported by sam.saffron (Sam Saffron).
3 messages
2017/05/04
[#81016] [Ruby trunk Bug#13526] Segmentation fault at 0x0055c2e58e8920 ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] — s.wanabe@...
Issue #13526 has been updated by wanabe (_ wanabe).
3 messages
2017/05/07
[#81048] Re: [ruby-cvs:65788] normal:r58614 (trunk): rb_execution_context_t: move stack, stack_size and cfp from rb_thread_t — SASADA Koichi <ko1@...>
It causes compile error on raspi 3.
3 messages
2017/05/09
[#81201] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle — "U.NAKAMURA" <usa@...>
Hi, Eric
4 messages
2017/05/16
[#81202] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle
— Eric Wong <normalperson@...>
2017/05/16
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#81427] Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534) — SASADA Koichi <ko1@...>
Hi,
6 messages
2017/05/28
[#81428] Re: Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534)
— Eric Wong <normalperson@...>
2017/05/28
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:81210] [Ruby trunk Bug#12373] Optimize CSV#shift
From:
co000ri@...
Date:
2017-05-17 04:05:50 UTC
List:
ruby-core #81210
Issue #12373 has been updated by ksss (Yuki Kurihara).
@hsbt
Thank you for responding.
csv-shift-hsbt.patch looks good to me.
> Should we use @double_quote_char instead of @quote_char ?
> your patch named csv-shift-3.patch is only assign @double_quote_char. It's not used in csv.rb
@double_quote_char and @quote_char are different values. It can not be used instead.
@double_quote_char looks like using in CSV#shift method on csv-shift-3.patch and csv-shift-hsbt.patch.
----------------------------------------
Bug #12373: Optimize CSV#shift
https://bugs.ruby-lang.org/issues/12373#change-64863
* Author: ksss (Yuki Kurihara)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Target version: 2.5
* ruby -v: ruby 2.4.0dev (2016-05-11 trunk 54976) [x86_64-darwin15]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
I think that **`str1.start_with?(str2)`** is faster than **`str1[0] == str2`**.
Because **`str1.start_with?(str2)`** just call **`String#start_with?`**, But **`str1[0] == str2`** call **`String#[]`**, make new `String` object and call **`String#==`**.
(The patch is csv-shift.patch)
Benchmark results.
csv-benchmark.rb make temp CSV file and call **`CSV#each`** method(inner call **`CSV#shift`**)
~~~
$ ruby csv-benchmark.rb
Warming up --------------------------------------
old_csv_shift 1.000 i/100ms
new_csv_shift 1.000 i/100ms
Calculating -------------------------------------
old_csv_shift 0.444 (賊 0.0%) i/s - 3.000 in 6.759200s
new_csv_shift 0.479 (賊 0.0%) i/s - 3.000 in 6.264069s
Comparison:
new_csv_shift: 0.5 i/s
old_csv_shift: 0.4 i/s - 1.08x slower
~~~
string-start_with.rb is a micro benchmark for **`str1[0] == str2`** and **`str1.start_with?(str2)`**
~~~
$ ruby string-start_with.rb
Warming up --------------------------------------
a[0] == b 90.881k i/100ms
a.start_with?(b) 115.557k i/100ms
Calculating -------------------------------------
a[0] == b 1.836M (賊 3.8%) i/s - 9.179M in 5.006568s
a.start_with?(b) 3.183M (賊 4.2%) i/s - 15.947M in 5.018654s
Comparison:
a.start_with?(b): 3183386.0 i/s
a[0] == b: 1836263.5 i/s - 1.73x slower
~~~
Of course $ make test-all TESTS="test/csv/*" passed
---Files--------------------------------
csv-benchmark.rb (561 Bytes)
old_csv_shift.rb (5.1 KB)
new_csv_shift.rb (5.11 KB)
string-start_with.rb (215 Bytes)
csv-shift.patch (434 Bytes)
csv-shift-1.patch (1.15 KB)
csv-shift-2.patch (1.2 KB)
csv-shift-3.patch (2.13 KB)
csv-shift-hsbt.path (2.05 KB)
--
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>