sstephenson/rbenv — pull request #253 by RubenVerborgh (2012-08-12 20:38:12+00:00)
Title: Speed up rbenv-init by inlining shell commands

**Problem**
`rbenv init -` is rather slow, which is an issue since it is used in shell startup scripts.
One of the causes is that inside `rbenv-init`, another call to `rbenv` is made:

commands=(`rbenv commands --sh`)

This makes the `rbenv init` command carry the rbenv startup overhead _twice_:
once for `init` itself, and once for `commands`.

**Proposed solution**
I have inlined the list of shell commands (currently only `shell`) to bypass this.

**Result**
On my system, execution times improved from

real 0m0.069s
user 0m0.022s
sys 0m0.047s

to

real 0m0.042s
user 0m0.012s
sys 0m0.029s

which is a 40% decrease.