Sha256: f77d4663353c94227a2f1daa7c144a7489b7b2071ac01c40e159df511915f8a8

Contents?: true

Size: 273 Bytes

Versions: 14

Compression:

Stored size: 273 Bytes

Contents

require_relative './shared'

str = 'Lorem ipsum ⛷ et dolorem'
rx = /\p{emoji}/
cs = CharacterSet.emoji

benchmark(
  caption: 'Extracting emoji to an Array',
  cases: {
    'String#scan'       => -> { str.scan(rx) },
    'CharacterSet#scan' => -> { cs.scan(str) },
  }
)

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
character_set-1.8.0-java tasks/benchmarks/scan.rb
character_set-1.8.0 tasks/benchmarks/scan.rb
character_set-1.7.0-java tasks/benchmarks/scan.rb
character_set-1.7.0 tasks/benchmarks/scan.rb
character_set-1.6.0-java benchmarks/scan.rb
character_set-1.6.0 benchmarks/scan.rb
character_set-1.5.0-java benchmarks/scan.rb
character_set-1.5.0 benchmarks/scan.rb
character_set-1.4.1-java benchmarks/scan.rb
character_set-1.4.1 benchmarks/scan.rb
character_set-1.4.0-java benchmarks/scan.rb
character_set-1.4.0 benchmarks/scan.rb
character_set-1.3.0-java benchmarks/scan.rb
character_set-1.3.0 benchmarks/scan.rb