Skip to content

Instantly share code, notes, and snippets.

View jhawthorn's full-sized avatar
⌨️

John Hawthorn jhawthorn

⌨️
View GitHub Profile

Testing performance from rails/rails#35629

This only compares this PR vs its parent. (ie. "before" already includes #35623)

I stacked the deck a little to make this change look as good as possible:

  • Rendered quite a few different templates
  • Used a very fast test app
  • Commented out js/css tags in header (the slowest part of the page in dev)

But the results were very good:

Testing 123 😼
@jhawthorn
jhawthorn / main.workflow
Last active January 14, 2019 08:42
GitHub actions workflow for my static site https://github.com/jhawthorn/site-example for more
workflow "Build and deploy on push" {
on = "push"
resolves = [
"Branch master",
"Invalidate cache",
]
}
action "Build" {
uses = "docker://ruby:latest"
@jhawthorn
jhawthorn / todo_test.gemspec
Created January 1, 2019 04:47
This gem is about TODOs https://twitter.com/searls/status/1079929935660236801
require "fullwidth" # https://github.com/jhawthorn/fullwidth
Gem::Specification.new do |spec|
spec.name = "todo_test"
spec.version = "0.0.0"
spec.authors = ["John Hawthorn"]
spec.email = ["john@hawthorn.email"]
spec.summary = %q{This gem is about TODOs}.to_fullwidth
spec.description = %q{This gem is about TODOs. lol}.to_fullwidth
@jhawthorn
jhawthorn / dtruss.txt
Created September 13, 2018 00:14
Dir["app/views/users/show*"]
getattrlist("app\0", 0x7FFEEC328C50, 0x7FFEEC328C90) = 0 0
getattrlist("app/views\0", 0x7FFEEC328A70, 0x7FFEEC328AB0) = 0 0
getattrlist("app/views/users\0", 0x7FFEEC328890, 0x7FFEEC3288D0) = 0 0
sigprocmask(0x1, 0x0, 0x7FFEEC3292A0) = 0x0 0
sigaltstack(0x0, 0x7FFEEC329290, 0x0) = 0 0
openat(0xFFFFFFFFFFFFFFFE, "app/views/users\0", 0x1100000, 0x1) = 7 0
fstat64(0x7, 0x7FFEEC329220, 0x0) = 0 0
fcntl_nocancel(0x7, 0x2, 0x1) = 0 0
fstatfs64(0x7, 0x7FFEEC328968, 0x0) = 0 0
getdirentries64(0x7, 0x7FA162008000, 0x1000) = 104 0
@jhawthorn
jhawthorn / dtruss.txt
Last active September 12, 2018 23:58
app/views/users/show{.en,}{.html,.text,.js,.css,.ics,.csv,.vcf,.vtt,.png,.jpeg,.gif,.bmp,.tiff,.svg,.mpeg,.mp3,.ogg,.m4a,.webm,.mp4,.otf,.ttf,.woff,.woff2,.xml,.rss,.atom,.yaml,.multipart_form,.url_encoded_form,.json,.pdf,.zip,.gzip,}{}{.raw,.erb,.html,.builder,.ruby,}
getattrlist("app\0", 0x7FFEEE3598D0, 0x7FFEEE359910) = 0 0
getattrlist("app/views\0", 0x7FFEEE3596F0, 0x7FFEEE359730) = 0 0
getattrlist("app/views/users\0", 0x7FFEEE359510, 0x7FFEEE359550) = 0 0
getattrlist("app/views/users/show.en.html.raw\0", 0x7FFEEE359330, 0x7FFEEE359370) = -1 Err#2
getattrlist("app\0", 0x7FFEEE3598D0, 0x7FFEEE359910) = 0 0
getattrlist("app/views\0", 0x7FFEEE3596F0, 0x7FFEEE359730) = 0 0
getattrlist("app/views/users\0", 0x7FFEEE359510, 0x7FFEEE359550) = 0 0
getattrlist("app/views/users/show.en.html.erb\0", 0x7FFEEE359330, 0x7FFEEE359370) = -1 Err#2
getattrlist("app\0", 0x7FFEEE3598D0, 0x7FFEEE359910) = 0 0
getattrlist("app/views\0", 0x7FFEEE3596F0, 0x7FFEEE359730) = 0 0
@jhawthorn
jhawthorn / Gemfile
Last active July 4, 2018 18:12
bundler vs bundler-explain: A real world Gemfile during an upgrade to Rails 5 https://github.com/jhawthorn/bundler-explain
source 'https://rubygems.org'
gem 'rails', '~> 5.0.0'
# Soft-deletion
gem 'paper_trail'
gem 'discard', '~> 1.0'
# auth
gem 'pundit'
$ ruby report.rb
Outage from 2018-06-07 02:50:49 -0700 to 2018-06-07 02:58:32 -0700
duration: 8 minutes
pings lost: 77% (34 / 44)
average ping: 22ms
Outage from 2018-06-07 05:07:10 -0700 to 2018-06-07 05:21:04 -0700
duration: 14 minutes
pings lost: 83% (65 / 78)
average ping: 16ms
# A stable ping target
# pretty much anything is more reliable than shaw
target_ip = "1.1.1.1"
# Maximum wait time in seconds.
wait = 1
interval = 10
require 'fileutils'
$ ruby -v
truffleruby 0.30.2, like ruby 2.3.5 <Java HotSpot(TM) 64-Bit Server VM 1.8.0_151-b12 with Graal> [linux-x86_64]
$ time =ruby -e ''
=ruby -e '' 16.52s user 0.37s system 350% cpu 4.821 total
$ time =ruby --native -e ''
=ruby --native -e '' 0.12s user 0.03s system 98% cpu 0.159 total
$ time =ruby 15a.rb