diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-29 09:10:32 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-29 09:10:32 +0000 |
commit | d02b10a3ea42eb17c6a8bf8ba61d557a33b0da48 (patch) | |
tree | 6ed8059cdc4d5ef94f8cc4b73510bdf581be3105 /gc.c | |
parent | 5651a91e2c78dcb78b6c109e0d7d1a775d83d596 (diff) | |
download | ruby-d02b10a3ea42eb17c6a8bf8ba61d557a33b0da48.tar.gz |
* encoding.c (rb_enc_check_str): add for performance.
This function only accept T_STRING (and T_REGEXP).
This patch improves performance of a tiny_segmenter benchmark
(num=2) 2.54sec -> 2.42sec on my machine.
https://github.com/chezou/TinySegmenter.jl/blob/master/benchmark/benchmark.rb
* encoding.c: add ENC_DEBUG and ENC_ASSERT() macros.
* internal.h: add a decl. of rb_enc_check_str().
* string.c (rb_str_plus): use rb_enc_check_str().
* string.c (rb_str_subpat_set): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
0 files changed, 0 insertions, 0 deletions