ruby/ruby — pull request #461 by charliesome (2013-12-01 11:23:39+00:00)
Title: Use an array instead of a hash table for id_str

Ruby spends a non-trivial amount of time in `rb_id2str` when booting the GitHub Rails app:

![screen shot 2013-12-01 at 10 17 02 pm](https://f.cloud.github.com/assets/179065/1650278/9bdfef58-5a7a-11e3-8637-562ad91605e1.png)

This pull request changes `global_symbols.id_str` to be an array instead of a hash table. Because ID values are sequentially increasing integers, using a hashtable for `id_str` is unnecessary and slow.

This improves the boot time of our app by about 150-200ms.

Before:

```
6.65 real 5.40 user 1.23 sys
6.76 real 5.47 user 1.25 sys
6.58 real 5.35 user 1.20 sys
6.62 real 5.39 user 1.20 sys
6.69 real 5.44 user 1.21 sys
```

After:

```
6.41 real 5.19 user 1.19 sys
6.45 real 5.22 user 1.20 sys
6.45 real 5.21 user 1.20 sys
6.46 real 5.22 user 1.20 sys
6.43 real 5.20 user 1.20 sys
```

cc @ko1