This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'benchmark' | |
RACTORS = ARGV.first == "ractor" | |
J = { rand => rand }.to_json | |
Ractor.make_shareable(J) | |
iterations = 1_000_000 | |
Benchmark.bmbm do |x| | |
x.report("json parse#{RACTORS ? ' (ractors)' : ''}") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test/template/benchmark/render_erb_test.rb | |
# encoding: utf-8 | |
require 'abstract_unit' | |
require 'controller/fake_models' | |
require 'benchmark/ips' | |
class TestController < ActionController::Base | |
end | |
class RenderErbBenchmarks < ActiveSupport::TestCase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1.9.3)luke@luke-K52F:~/Desktop/code/rails/actionview$ ruby -Itest test/template/benchmark/render_erb_test.rb | |
Run options: --seed 48936 | |
# Running: | |
Calculating ------------------------------------- | |
small erb template 136 i/100ms | |
------------------------------------------------- | |
small erb template 1479.1 (±8.1%) i/s - 7344 in 5.007999s | |
.Calculating ------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1.9.3)luke@luke-K52F:~/Desktop/code/rails/actionview$ ruby -Itest test/template/benchmark/render_erb_test.rb | |
Run options: --seed 33848 | |
# Running: | |
Calculating ------------------------------------- | |
small erb template 178 i/100ms | |
------------------------------------------------- | |
small erb template 1974.9 (±9.0%) i/s - 9790 in 5.009835s | |
.Calculating ------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run options: --seed 49067 | |
# Running: | |
Calculating ------------------------------------- | |
small erb template 710 i/100ms | |
------------------------------------------------- | |
small erb template 8263.7 (±21.2%) i/s - 39760 in 5.027179s | |
.Calculating ------------------------------------- | |
small erb template with 1 partial |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1.9.3)luke@luke-K52F:~/Desktop/code/rails/actionview$ ruby -Itest test/template/benchmark/render_erb_test.rb | |
Run options: --seed 49022 | |
# Running: | |
Calculating ------------------------------------- | |
small erb template 761 i/100ms | |
------------------------------------------------- | |
small erb template 10220.5 (±21.5%) i/s - 48704 in 5.003189s | |
.Calculating ------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Order | |
def send_order_email | |
OrderMailer.send_email(self).deliver | |
end | |
def test_order_email | |
body = send_order_email.body.to_s | |
File.open(File.join(Rails.root, 'public', 'email_test.html'), 'w') do |f| | |
f.puts body | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
app: /home/luke/workspace/traffic | |
paths: | |
java: /usr/lib/jvm/java-6-sun-1.6.0.26/bin | |
android: /home/luke/android-sdks | |
android-ndk: /home/luke/android-ndk-r7 | |
cabwiz: C:/Program Files/Windows Mobile 6 SDK/Tools/CabWiz | |
4.6: | |
jde: C:/Program Files/Research In Motion/BlackBerry JDE 4.6.0 | |
mds: C:/Program Files/Research In Motion/BlackBerry JDE 4.6.0/MDS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
app: /home/luke/workspace/traffic | |
paths: | |
java: /usr/lib/jvm/java-6-sun-1.6.0.26/bin | |
android: /home/luke/android-sdks | |
android-ndk: /home/luke/android-ndk-r7 | |
cabwiz: C:/Program Files/Windows Mobile 6 SDK/Tools/CabWiz | |
4.6: | |
jde: C:/Program Files/Research In Motion/BlackBerry JDE 4.6.0 | |
mds: C:/Program Files/Research In Motion/BlackBerry JDE 4.6.0/MDS |
NewerOlder