Project

General

Profile

« Previous | Next » 

Revision bfc887f3

Added by peterzhu2118 (Peter Zhu) almost 3 years ago

Add str_enc_copy_direct

This commit adds str_enc_copy_direct, which is like str_enc_copy but
does not check the frozen status of str1 and does not check the validity
of the encoding of str2. This makes certain string operations ~5% faster.

puts(Benchmark.measure do 100_000_000.times do "a".downcase end end) 

Before this patch:

 7.587598 0.040858 7.628456 ( 7.669022) 

After this patch:

 7.133128 0.039809 7.172937 ( 7.183124)