Skip to content

Instantly share code, notes, and snippets.

@stijlist
stijlist / blag.md
Last active October 29, 2021 18:57
python_startup_time_blog

speeding up python startup time with io_uring

(trying the one-pass / no editing blog post style)

A few months ago I learned that python (and other interpreted languages') RPATH lookups involve a non-trivial amount of compute. For each invocation of the python interpreter, python makes ~hundreds of serial calls to stat and related functions before running user code (cf. ['What I've Learned About Optimizing Python'][0], [ENOENT caching in distri][1]). Each stat system call costs some amount of time (~200ns-5us) and also causes a [context switch][2] into and out of the kernel. There are many workloads which invoke the Python interpreter 100s of times.

I was curious whether it'd be worth using io_uring for reducing startup and module importing overhead.

Wesley and I looked at this this morning - our plan was roughly:

Keybase proof

I hereby claim:

  • I am stijlist on github.
  • I am stijlist (https://keybase.io/stijlist) on keybase.
  • I have a public key ASAB3FlQD0vCo7jDOfq5PHjc2zVJCV1eqF0tXbVCArX2qwo

To claim this, I am signing this object:

@stijlist
stijlist / core.cljs
Last active May 30, 2016 16:39
2nd om/transact! not causing a re-render
(ns enough.core
(:require
[goog.dom :as dom]
[om.next :as om :refer-macros [defui]]
[sablono.core :refer-macros [html]]))
(enable-console-print!)
(defmulti read om/dispatch)
(defmulti mutate om/dispatch)
@stijlist
stijlist / flexbox-grid.scss
Created October 10, 2015 18:20 — forked from zeusdeux/flexbox-grid.scss
flexbox based simple grid system
/* Simple flexbox based grid system */
$columns: 12;
@mixin layout-cols($device) {
@for $i from 1 through 12 {
.l-#{$device}-col-#{$i} {
flex: 0 0 $i / $columns * 100%;
}
}
@stijlist
stijlist / gist:bb932fb93e22fe6260b2
Last active July 12, 2020 06:43
rich-hickey-mastery
Rich Hickey on becoming a better developer
Avatar
Rich Hickey • 3 years ago
Sorry, I have to disagree with the entire premise here.
A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.
Mastery comes from a combination of at least several of the following:
require 'nokogiri'
require 'open-uri'
require 'chronic'
post_titles_and_dates = (1..3).flat_map do |i|
page = Nokogiri::HTML(open("http://somethingdoneright.net/page/#{i}"))
blog_posts = page.css(".post")
# need to go from post title and post date to YEAR-MONTH-DAY-title.MARKUP
blog_posts.map do |post|
title = post.at_css("h2")
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
class SmsController < ApplicationController
skip_before_filter :verify_authenticity_token, only: [:receive_sms]
def new_sms
# validate that user is an admin
redirect_to :root unless current_user && current_user.admin?
end
def send_sms
# Description:
# Looks up the phone number for a given name in the YF.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# Description:
# Looks up the phone number for a given name in the YF.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands: