Sha256: 3f9cbbe9cdb195ffbfea4c4de2dda1903af6fd629671b8c3fd560741d78ca8ae
Contents?: true
Size: 596 Bytes
Versions: 8
Compression:
Stored size: 596 Bytes
Contents
prelude: | require 'erb' template = <<EOS <html> <head> <%= title %> </head> <body> <h1> <%= title %> </h1> <p> <%= content %> </p> </body> </html> EOS title = "hello world!" content = "hello world!\n" * 10 benchmarks: - name: ERB compiling benchmark: ERB.new(template) loop_count: 10000 - name: ERB rendering prelude: | src = "def self.render(title, content); #{ERB.new(template).src}; end" mod = Module.new mod.instance_eval(src, "(ERB)") benchmark: mod.render(title, content) loop_count: 100000
Version data entries
8 entries across 8 versions & 2 rubygems