- name: erb_compile prelude: | require 'erb' title = "hello world!" content = "hello world!\n" * 10 data = < <%= title %>

<%= title %>

<%= content %>

EOS benchmark: | ERB.new(data).src - name: erb_render prelude: | require 'erb' title = "hello world!" content = "hello world!\n" * 10 data = < <%= title %>

<%= title %>

<%= content %>

EOS src = "def self.render(title, content); #{ERB.new(data).src}; end" mod = Module.new mod.instance_eval(src, "(ERB)") benchmark: | mod.render(title, content)