ManageIQ/manageiq — pull request #889 by jrafanie (2014-10-20 17:24:30+00:00)
Title: Less hashy configuration encoder

Using [stackprof](https://github.com/tmm1/stackprof), ruby 2.1.3, and a simple script that does VMDB::Config.new("vmdb"), the attached PR drops object allocations by nearly 6%.

The second and third commit show why we're adding the first commit.

```ruby
require 'stackprof'
StackProf.run(mode: :object, out: 'tmp/stackprof-object-vmdb-config-new-after.dump') do
VMDB::Config.new("vmdb")
end
```
```
# stackprof tmp/stackprof-object-vmdb-config-new-after.dump --text --limit 500 |grep -Ei "Samples|ConfigurationEncoder"
Samples: 75824 (0.00% miss rate)
TOTAL (pct) SAMPLES (pct) FRAME
1568 (2.1%) 1566 (2.1%) block in Vmdb::ConfigurationEncoder.decrypt_password_fields!
5982 (7.9%) 206 (0.3%) Vmdb::ConfigurationEncoder.walk_nested_hashes
25105 (33.1%) 7 (0.0%) Vmdb::ConfigurationEncoder.load
1778 (2.3%) 4 (0.0%) Vmdb::ConfigurationEncoder.decrypt_password_fields!
```

```
# stackprof tmp/stackprof-object-vmdb-config-new-before.dump --text --limit 500 |grep -Ei "Samples|ConfigurationEncoder"
Samples: 80497 (0.00% miss rate)
TOTAL (pct) SAMPLES (pct) FRAME
1568 (1.9%) 1566 (1.9%) block in Vmdb::ConfigurationEncoder.decrypt_password_fields
5982 (7.4%) 206 (0.3%) Vmdb::ConfigurationEncoder.walk_nested_hashes
29765 (37.0%) 7 (0.0%) Vmdb::ConfigurationEncoder.load
3114 (3.9%) 4 (0.0%) Vmdb::ConfigurationEncoder.decrypt_password_fields
```