mitchellh/go-homedir — pull request #1 by rubenv (2014-08-27 15:27:05+00:00)
Title: Cache homedir between invocations.

The homedir of a user doesn't change anyway. Massively speeds up the
case where $HOME isn't set.

```
Before: BenchmarkDir 1000 2571286 ns/op
After: BenchmarkDir 1000000000 2.77 ns/op
```

Repeatedly forking `sh` is slow, this commit causes it to only happen once.