I was working on grok and wanted to test various execution speeds of the same pattern written different ways. I picked the quoted string pattern from grok and went to town.
While I found no discernible differences in the different patterns and speeds, I did find that JRuby's Joniguruma beats the pants off of Ruby 1.9.2's Oniguruma regexp engine.
With some rounding, the average in ruby 1.9.2 was 530000 matches/sec, while Jruby 1.6.5 in 1.9 mode averaged 690000 matches/sec.
That's 30% faster in JRuby with no code changes.
Rate: 531456.3673108591 (?-mix:('(?:[^\\']+|(?:\\.)+)*'))
Rate: 532358.8482186638 (?-mix:('(?:[^\\']+|(?:\\.))*'))
Rate: 532718.207312862 (?-mix:('(?:\\.|[^\\']+)*'))
Rate: 537258.5459318311 (?-mix:('(?:[^\\']+|(?:\\.)+)*'))
Rate: 531908.6117197308 (?-mix:('(?:[^\\']+|(?:\\.))*'))
Rate: 537653.6067093286 (?-mix:('(?:\\.|[^\\']+)*'))
Rate: 658587.987355111 (?-mix:('(?:[^\\']+|(?:\\.)+)*'))
Rate: 685682.940208448 (?-mix:('(?:[^\\']+|(?:\\.))*'))
Rate: 704374.163555681 (?-mix:('(?:\\.|[^\\']+)*'))
Rate: 690941.753610171 (?-mix:('(?:[^\\']+|(?:\\.)+)*'))
Rate: 689750.31038764 (?-mix:('(?:[^\\']+|(?:\\.))*'))
Rate: 681523.887412254 (?-mix:('(?:\\.|[^\\']+)*'))