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:

@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:

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)
NoMethodError - undefined method `type' for nil:NilClass:
activerecord (4.0.0) lib/active_record/attribute_methods/time_zone_conversion.rb:54:in `create_time_zone_conversion_attribute?'
activerecord (4.0.0) lib/active_record/attribute_methods/time_zone_conversion.rb:34:in `define_method_attribute='
activemodel (4.0.0) lib/active_model/attribute_methods.rb:286:in `block in define_attribute_method'
activemodel (4.0.0) lib/active_model/attribute_methods.rb:279:in `define_attribute_method'
activemodel (4.0.0) lib/active_model/attribute_methods.rb:246:in `block in define_attribute_methods'
activemodel (4.0.0) lib/active_model/attribute_methods.rb:246:in `define_attribute_methods'
activerecord (4.0.0) lib/active_record/attribute_methods.rb:29:in `block in define_attribute_methods'
activerecord (4.0.0) lib/active_record/attribute_methods.rb:26:in `define_attribute_methods'
activerecord (4.0.0) lib/active_record/attribute_methods.rb:167:in `respond_to?'
<section class='retreat-theme'>
<div class="row">
<div class="large-12 columns center">
<div class="retreat-heading">
<p class="retreat-date">January 10-12, 2014</p>
<h1 class="retreat-logo">Whatcha Gonna Do?</h1>
<h4 class="retreat-verse">"Do not merely listen to the word, and so deceive yourselves. Do what it says." - James 1:22</h4>
<span class="retreat-amount">$85</span>
</div>
</div>
<section class='retreat-theme'>
<div class="row">
<div class="large-12 columns center">
<div class="retreat-heading">
<p class="retreat-date">January 10-12, 2014</p>
<h1 class="retreat-logo">Whatcha Gonna Do?</h1>
<h4 class="retreat-verse">"Do not merely listen to the word, and so deceive yourselves. Do what it says." - James 1:22</h4>
<span class="retreat-amount">$85</span>
</div>
</div>
@stijlist
stijlist / brew-doctor-output.txt
Created October 11, 2013 09:38
Rubinius fails to build on 10.8
bash-3.2$ brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
@stijlist
stijlist / _form.html.erb
Created August 17, 2013 15:44
Trying to understand why my submit handlers don't fire in the new action of a default rails 4 controller.
<h1>Charge $10 with Stripe</h1>
<form action="" method="POST" id="payment-form">
<span class="payment-errors"></span>
<div class="form-row">
<label>
<span>Card Number</span>
<input type="text" size="20" data-stripe="number"/>
</label>
@stijlist
stijlist / credit_cards.html
Last active December 21, 2015 01:39
Stripe code for my church's Youth Fellowship website.
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />