From: ts Date: 2002-07-11T01:46:59+09:00 Subject: Re: String#split converts string args to regexes -- ? >>>>> "T" == Tom Sawyer writes: T> s = "xyz" * 1000000 T> a1 = s.split('y') It don't use String#index in this case T> On Wed, 2002-07-10 at 09:24, Yukihiro Matsumoto wrote: >> Hi, >> >> In message "Re: String#split converts string args to regexes -- ?" >> on 02/07/10, Tom Sawyer writes: >> >> |and, if implemented without regexps, could easily boost performance, >> |which IMHO is an important bonus considering speed is probably the >> |primary site against ruby in comparison to perl and python. >> >> regex is highly optimized for searching. search using regex >> (e.g. str.index(/pat/)) is almost always faster than search using >> strings (e.g. str.index("pat")). ^^^^^^^^^^^^^^^^^^^^^ Guy Decoux