Skip to content

Instantly share code, notes, and snippets.

@tgxworld
Last active August 29, 2015 14:03
Show Gist options
  • Save tgxworld/c656e57227cfc008f705 to your computer and use it in GitHub Desktop.
Save tgxworld/c656e57227cfc008f705 to your computer and use it in GitHub Desktop.
Disabling Logging and Skipping Turbolinks filter
# Before https://github.com/rails/rails/commit/4fd144dd4bb0e1ede5a4857c178138088353a3d1 on May 13
Calculating -------------------------------------
Integration Test 59 i/100ms
Functional Test 84 i/100ms
-------------------------------------------------
Integration Test 599.5 (±11.0%) i/s - 3009 in 5.087300s
Functional Test 882.1 (±10.2%) i/s - 4368 in 5.008871s
# Benchmark as of July 8
Calculating -------------------------------------
Integration Test 65 i/100ms
Functional Test 91 i/100ms
-------------------------------------------------
Integration Test 651.3 (±4.5%) i/s - 3315 in 5.100042s
Functional Test 924.7 (±3.2%) i/s - 4641 in 5.024486s
# Benchmark with Turbolink filters skipped
Calculating -------------------------------------
Integration Test 77 i/100ms
Functional Test 96 i/100ms
-------------------------------------------------
Integration Test 789.2 (±6.3%) i/s - 4004 in 5.094798s
Functional Test 985.6 (±6.2%) i/s - 4992 in 5.085927s
# Benchmark with Logging level set to Logger::FATAL
Calculating -------------------------------------
Integration Test 81 i/100ms
Functional Test 111 i/100ms
-------------------------------------------------
Integration Test 831.7 (±6.0%) i/s - 4212 in 5.083697s
Functional Test 1008.4 (±14.0%) i/s - 4995 in 5.056512s
# Benchmark with Logging level set to Logger::FATAL and Turbolink filters skipped
Calculating -------------------------------------
Integration Test 92 i/100ms
Functional Test 116 i/100ms
-------------------------------------------------
Integration Test 930.6 (±6.2%) i/s - 4692 in 5.062400s
Functional Test 1159.4 (±6.0%) i/s - 5800 in 5.021728s
require 'test_helper'
require 'benchmark/ips'
class UserFlowTest < ActionDispatch::IntegrationTest
def test_index
get "http://www.example.com/users"
assert_equal 200, response.status
end
end
class UserFlowTest2 < ActionController::TestCase
tests UsersController
def test_index
get :index
assert_equal 200, response.status
end
end
Benchmark.ips(5) do |bm|
bm.report 'Integration Test' do
Minitest.run_one_method(UserFlowTest, 'test_index')
end
bm.report 'Functional Test' do
Minitest.run_one_method(UserFlowTest2, 'test_index')
end
end
class UsersController < ApplicationController
# GET /users
# GET /users.json
def index
@user = User.find(params[:id])
render plain: 'ok'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment