I may be talking rubbish, but this doesn't seem like the most efficient implementation. You're doing two full-table scans (each of them O(n) in the worst case) to find the index of each encoding. On the other hand, I know it's possible to look up an encoding by its name using `Encoding::EncodingMap#[]`, which is obviously O(1). That should return a `Rubinius::Tuple` whose last element is the encoding's index:

```ruby
enc = Encoding::ISO8859_1
tuple = Encoding::EncodingMap[enc.name]
tuple.last #=> 53
```

I'd love to hear @dbussink's thoughts on this though, I know he's not a fan of un-benchmarked optimisations :P