From: "Iñaki Baz Castillo" Date: 2008-04-15T18:04:52+09:00 Subject: Re: Is faster handling hexadecimal values than handling chars? 2008/4/15, Iñaki Baz Castillo : > Hi, could I know if it's faster using hexadecimal values instead of > charsm in Ruby? > I mean: > > a) char =~ /[\x61-\x7A]|[\x41-\x5A]/ > > b) char =~ /[A-Z]|[a-z]/ > > Both are the same, but maybe a) operation is faster than b) ? Sorry, I've found Benchmark Class and have tried it: Benchmark.realtime {'f' =~ /[\x61-\x7A]|[\x41-\x5A]/ } => 1.81198120117188e-05 Benchmark.realtime {'f' =~ /[A-Z]|[a-z]/ } => 1.81198120117188e-05 both give similar results. Best regards. -- Iñaki Baz Castillo