## Fast Gaussian-distributed Random Numbers

Recently, profiling showed me that most of the time in the microbenchmark I was running was spent generating the stream of random numbers using `Random.nextGaussian`. I didn’t need a high-quality Gaussian distribution—I just wanted some moderately realistic numbers—so, mostly …

## So, Patrick, how was your long weekend?

I took this past Monday as a vacation day. Upon returning, I sent this email to the team, and they suggested I post it here.

Upon returning from my vacation day, some of you may ask how my long weekend …

## Help! I invented an algorithm and I don’t know how it works!

This past weekend, I needed to find a good fraction to approximate a given value. Along the way, I learned about continued fractions, and emerged with a neat, efficient algorithm. The only trouble is, I can’t figure out why it …

## The Case for a Logarithmic Performance Metric

Traditional comparisons of benchmark results focus on percentage differences. While seemingly simple to understand and compute, such comparisons pose a number of problems that are solved by using a different basis for comparison: a logarithmic unit with the rather unfortunate …

## Measuring information in millibytes

A thousandth of one byte. Does such a thing even exist?

Yep, it does. I’ve used them before.

# How to debug an optimizing compiler

Suppose you work on an optimizing compiler that has a bug, causing the compiled program to …

## Gotcha! Cartesian products of Java 8 streams

Occasionally, you need to compute the Cartesian product of several sets. Java 8 Streams make this simple, clear, elegant… and extravagantly expensive. I’ve created a `Cartesian` helper class that solves the memory usage problem, and allows Cartesian products to be …

## The Inflatable Transpose Tree: a highly compact data structure

In honour of Claude Shannon’s 100th birthday, I want to tell you about two ideas I had for storing data efficiently. These ideas are pretty nifty individually, but together, they form a data structure that allows a large amount …

## Malloc Envy

Folks using programming languages with automatic garbage collection (GC) often feel that it’s a price worth paying. I disagree: outside of some fairly limited circumstances, there’s no price to be paid at all.

If your application is short-running, or …

## Technical Talk at University of Toronto on March 23

A few of us will be visiting U of T next week to give a talk on Vena’s Calc programming language. If you like programming languages and compilers, come by SF3202 at 5:00pm on Wednesday, March 23 to hear us …