Sha256: b3f552c9a2ef690b4f7fd35abeb7e78707444b2fe10b1eaca850717911445737

Contents?: true

Size: 690 Bytes

Versions: 23

Compression:

Stored size: 690 Bytes

Contents

# encoding: UTF-8
$KCODE = 'u' unless "1.9".respond_to?(:encoding)

$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "htmlentities"

class HTMLEntitiesJob
  def initialize
    @coder = HTMLEntities.new
    @decoded = File.read(File.join(File.dirname(__FILE__), "sample"))
    @encoded = @coder.encode(@decoded, :basic, :named, :hexadecimal)
  end

  def encode(cycles)
    cycles.times do
      @coder.encode(@decoded, :basic, :named, :hexadecimal)
      @coder.encode(@decoded, :basic, :named, :decimal)
    end
  end

  def decode(cycles)
    cycles.times do
      @coder.decode(@encoded)
    end
  end

  def all(cycles)
    encode(cycles)
    decode(cycles)
  end
end

Version data entries

23 entries across 23 versions & 9 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/htmlentities-4.3.4/perf/performance.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/htmlentities-4.3.4/perf/performance.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/htmlentities-4.3.4/perf/performance.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/htmlentities-4.3.4/perf/performance.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/htmlentities-4.3.4/perf/performance.rb
jerska-htmlentities-4.3.3 perf/performance.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/htmlentities-4.3.4/perf/performance.rb
megam_htmlentities-4.3.4 perf/performance.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/htmlentities-4.3.4/perf/performance.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/htmlentities-4.3.4/perf/performance.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/htmlentities-4.3.4/perf/performance.rb
htmlentities-4.3.4 perf/performance.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/htmlentities-4.3.3/perf/performance.rb
htmlentities-4.3.3 perf/performance.rb
htmlentities-4.3.2 perf/performance.rb
htmlentities-4.3.1 perf/performance.rb
htmlentities-4.3.0 perf/performance.rb
htmlentities-4.2.4 perf/performance.rb
htmlentities-4.2.3 perf/performance.rb
htmlentities-4.2.2 perf/performance.rb