Skip to content

Instantly share code, notes, and snippets.

Fibers

Fibers are an abstraction over sequential computation, similar to threads but at a higher level. There are two ways to think about this model: by example, and abstractly from first principles. We'll start with the example.

(credit here is very much due to Fabio Labella, whose incredible Scala World talk describes these ideas far better than I can)

Callback Sequentialization

Consider the following three functions

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@denisftw
denisftw / .profie
Created October 13, 2017 11:14
profie fix for Chrome hinting
export FREETYPE_PROPERTIES="truetype:interpreter-version=35"
@denisftw
denisftw / webpack.config.js
Created January 13, 2016 15:05
Webpack staring point (React, Babel, Fetch)
var webpack = require('webpack');
module.exports = {
entry: './ui/entry.js',
output: { path: __dirname + '/public/compiled', filename: 'bundle.js' },
module: {
loaders: [
{ test: /\.jsx?$/, loader: 'babel-loader', include: /ui/, query: { presets: ['es2015', 'react'] } }
]
},
@denisftw
denisftw / fonts.conf
Last active April 25, 2022 19:42
Font configuration file for Linux
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- ~/.config/fontconfig/fonts.conf -->
<match target="font" >
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
</match>
<match target="font" >