Skip to content

Instantly share code, notes, and snippets.

View nateberkopec's full-sized avatar

Nate Berkopec nateberkopec

View GitHub Profile
@nateberkopec
nateberkopec / 0_roadmap.md
Last active March 31, 2025 19:35
Speedshop Retainer Roadmap + Changelog

Speedshop Retainer Roadmap

This is the roadmap for the Speedshop Ruby on Rails performance retainer service. It was last updated March 28th, 2025. Items are in rough priority order.

In-Progress:

  1. Alerting and dashboard scorecards: We want everyone to be on the same footing with SLOs for queues and tracking our core set of 20 metrics, plus your app's specific key metrics (see next bullet). The output will be a scorecard page that's pass/fail on each point.
  2. Formalizing key metrics with everyone: Since we started the retainer, we learned it's helpful to have a set of 3 or fewer key metrics to monitor and improve upon over the course of the retainer. If we haven't already formalized these with you, we'll do so.
  3. Automated checks: jemalloc, YJIT, RMP, SQL comments, bcrypt version. We have a few automated checks that can be implemented just by reading your source code and doing a couple of static checks. We'll also ship some detailed guides for
@nateberkopec
nateberkopec / changelog.md
Last active March 28, 2025 03:37
Speedshop Retainer Changelog

Speedshop Retainer Changelog

This is the changelog for the Speedshop Ruby on Rails performance retainer service. For what we're doing in the future, see the roadmap. This was last updated March 28th, 2025.

March 2025

  1. Office Hours. You can now sign up for regular office hours, 30 minutes every 2 weeks.
  2. Retainer Roadmap and Changelog. We're working on more services and extensions to the retainer service. You can keep up with stuff yet to come in the Roadmap, and stuff done already in the Changelog.
  3. Free Ongoing Education/Workshops. We started a book club for The Rails Performance Apocrypha.
/nix/store/9j0c1bk7rq7fkc7bcf4q25wk6rjm1z3d-gnumake-4.3/bin/make install target_prefix=
/nix/store/1qw1shw2a163h45rhr5pay488nbzfi6y-coreutils-9.0/bin/install -c -m 0755 puma_http11.so /host/nateberkopec/Documents/Code/upstream/puma/lib/puma
cp tmp/aarch64-linux/puma_http11/3.0.2/puma_http11.so tmp/aarch64-linux/stage/lib/puma/puma_http11.so
/host/nateberkopec/Documents/Code/upstream/puma/test/test_config.rb:70: warning: assigned but unused variable - bind_configuration
/host/nateberkopec/Documents/Code/upstream/puma/test/test_config.rb:71: warning: assigned but unused variable - app
ruby 3.0.2p107 (2021-07-07) [aarch64-linux]
RUBYOPT: -r/nix/store/6jdmjqw9m3n3n76z5dsig3d4anh091fm-ruby-3.0.2/lib/ruby/3.0.0/bundler/setup
Puma::MiniSSL OpenSSL
OPENSSL_LIBRARY_VERSION: OpenSSL 1.1.1l 24 Aug 2021 OpenSSL 1.1.1l 24 Aug 2021
@nateberkopec
nateberkopec / homebridge.hcl
Created March 28, 2021 01:06
Pihole and homekit HCLs for Nomad
job "homebridge" {
datacenters = ["dc1"]
group "server" {
network {
port "http" {
to = 8581
}
}
as scraped by @cjlarose
5.0.0 - Spoony Bard
4.3.0 - Mysterious Traveller
4.2.0 - Distant Airhorns
4.1.0 - Fourth and One
4.0.0 - 4 Fast 4 Furious
3.12.0 - Llamas in Pajamas
3.11.0 - Love Song
3.10.0 - Russell's Teapot
@nateberkopec
nateberkopec / tf-dev-script.sh
Last active June 3, 2020 09:13
tf-dev-script.sh
#!/bin/bash
# Assumes you have a DIGITALOCEAN_TOKEN env var pre-set
# Assumes you have terraform and mutagen installed
# Assumes DO has an SSH key uploaded
DO_REGION="sgp1" # Set to DO region: https://www.digitalocean.com/docs/platform/availability-matrix/
SSH_KEY_FINGERPRINT="your-key-fingerprint" # You can find this in your control panel
if [ -z $DIGITALOCEAN_TOKEN ]; then
exit 1
ruby-install truffleruby
>>> Installing truffleruby 19.3.0 into /Users/nateberkopec/.rubies/truffleruby-19.3.0 ...
>>> Installing dependencies for truffleruby 19.3.0 ...
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from a1939cfe7 to a4d7bb64a.
Updated 3 taps (shopify/shopify, homebrew/core and homebrew/cask).
==> New Formulae
libtorch onnxruntime tio vale
==> Updated Formulae
@nateberkopec
nateberkopec / git-autocomplete.sh
Created October 3, 2019 16:32
git auto completion
cd ~
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
mv git-completion.bash .git-completion.bash
source ~/.git-completion.bash
echo "source ~/.git-completion.bash" >> ~/.bash_profile
@nateberkopec
nateberkopec / thread.diff
Created February 14, 2019 20:28
thread quantum patch
diff --git a/thread_pthread.c b/thread_pthread.c
index d8d3184c62..4e28b9a31d 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -175,7 +175,7 @@ static const void *const condattr_monotonic = NULL;
/* 100ms. 10ms is too small for user level thread scheduling
* on recent Linux (tested on 2.6.35)
*/
-#define TIME_QUANTUM_MSEC (100)
+#define TIME_QUANTUM_MSEC (10)
@nateberkopec
nateberkopec / correction.md
Last active February 14, 2024 16:22
A Simple Correction

In yesterday's post I said, in relation to "how does .present? work on ActiveRecord::Relation", I said that present? performs an existence check SELECT 1 AS one FROM ... LIMIT 1 because it calls exists? underneath. This is actually wrong - it loads the relation.

Jonathan Mast corrected me on Twitter. It turns out, I should have paid closer attention! Here is the actual implementation of blank? on ActiveRecord::Relation on Rails master:

# Returns true if relation is blank.
def blank?
  records.blank?
end