[#80531] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...>
SASADA Koichi <ko1@ruby-lang.org> wrote:
On 2017/04/02 11:35, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
On 2017/05/08 9:33, Eric Wong wrote:
On 2017/05/08 10:53, SASADA Koichi wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/08 12:01, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/08 15:36, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/09 12:38, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/09 14:12, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2017/05/09 15:23, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
Thank you.
[#80763] [Ruby trunk Feature#13434] better method definition in C API — naruse@...
Issue #13434 has been updated by naruse (Yui NARUSE).
[#80844] [Ruby trunk Bug#13503] Improve performance of some Time & Rational methods — watson1978@...
Issue #13503 has been updated by watson1978 (Shizuo Fujita).
[#80892] [Ruby trunk Misc#13514] [PATCH] thread_pthread.c (native_sleep): preserve old unblock function — ko1@...
Issue #13514 has been updated by ko1 (Koichi Sasada).
ko1@atdot.net wrote:
On 2017/04/27 8:58, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
[ruby-core:80695] Re: [ruby-dev:50024] [Ruby trunk Bug#13341] Improve performance of implicit type conversion
+cc ruby-core since this post was English watson1978@gmail.com wrote: > Issue #13341 has been reported by watson1978 (Shizuo Fujita). > > ---------------------------------------- > Bug #13341: Improve performance of implicit type conversion > https://bugs.ruby-lang.org/issues/13341 Interesting... > ---------------------------------------- > At least, Array#flatten will be faster around 20%. > Seems that strncmp() & strcmp() in convert_type() are slightly heavy to look up the method's id for type conversion. > (https://github.com/ruby/ruby/blob/4f2db15b42d7b8eb5b304a92ba2296632dba3edf/object.c#L2634-L2643) > > This patch will use known method's id directly. > > ### Before > ~~~ > user system total real > Array#flatten (rb_check_convert_type2) 1.000000 0.000000 1.000000 ( 1.001917) > Array#+ (rb_convert_type2) 1.010000 0.000000 1.010000 ( 1.006383) > ~~~ > > ### After > ~~~ > user system total real > Array#flatten (rb_check_convert_type2) 0.830000 0.000000 0.830000 ( 0.833411) > Array#+ (rb_convert_type2) 0.950000 0.000000 0.950000 ( 0.953832) > ~~~ <snip> > The patch is in https://github.com/ruby/ruby/pull/1537 I use "fetch = +refs/pull/*:refs/remotes/pull/*" in my .git/config to check pull/1537/head in ruby.git without using only standard git (no proprietary JavaScript) and looked at following commits: e189f53a26 use rb_convert_type2() for #to_r 5e836acef6 Improve performance of implicit type conversion So yes, I hate strcmp/strncmp, too. If we change the API, I prefer we drastically shorten the function args for common case types. I'm not sure if including new APIs in ruby/intern.h is a good idea right away, since that is technically public API. Perhaps keep it in internal.h for now. So, maybe: rb_convert_type2(a1, idTo_a); rb_convert_type2(a1, idTo_ary); will lookup a small static table based on ID which fills in T_*** (and tname string for error reporting). Corner cases like StringIO may use old API, maybe that is less critical. Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>