[ruby-cvs:67267] glass:r60086 (trunk): string.c: avoid unnecessary call of str_strlen()

glass at ruby-lang.org glass at ruby-lang.org
Sun Oct 1 22:44:49 JST 2017


glass	2017-10-01 22:44:49 +0900 (Sun, 01 Oct 2017)

  New Revision: 60086

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60086

  Log:
    string.c: avoid unnecessary call of str_strlen()
    
    * string.c (rb_strseq_index): refactor and avoid
      call of str_strlen() when offset == 0.
      it will improve performance of String#index and #include?
    
    * benchmark/bm_string_index.rb: benchmark for this change

  Added files:
    trunk/benchmark/bm_string_index.rb
  Modified files:
    trunk/string.c


More information about the ruby-cvs mailing list