Project

General

Profile

« Previous | Next » 

Revision fdbd3716

Added by nobu (Nobuyoshi Nakada) over 11 years ago

array.c: speedup Array#unshift by using space in shared array

  • array.c: speedup Array#unshift by using space in shared array.
    [Feature #6638]
    • when array owns its shared array (ARY_SHARED_NUM == 1), and there
      is enough space then try unshift values directly into shared
      array.
    • when resulting array is big (~>64 items) then make it shared with
      enough room for future #unshifts, and then insert into shared
      array.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e