# Speeding up ri

**URL:** <https://rubytalk.org/t/speeding-up-ri/31542>\
**Category:** ruby-talk\
**Created:** [2 October 2006 20:11 UTC](https://rubytalk.org/t/speeding-up-ri/31542 "2006-10-02T20:11:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gavin\_Kistner](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@Gavin\_Kistner](https://rubytalk.org/u/Gavin_Kistner)\
**Post date:** [2 October 2006 20:11 UTC](https://rubytalk.org/t/speeding-up-ri/31542/1 "2006-10-02T20:11:52Z")

</div>

On my machine (3GHz P4, 1GB RAM, Windows and other apps running) I just  
opened up a command prompt and typed "ri ERB".

Then I realized that ri has become heinously slow since I upgraded to  
1.8.5.  
So I opened a browser window.  
I typed in [ruby-doc.org/stdlib](http://ruby-doc.org/stdlib).  
I let the browser load the frameset and pages.  
I clicked on ERB in the left side.  
I let the browser load the new frameset and pages.  
I clicked on the ERB.new method.  
I got to the page I want.  
... and I STILL beat the output of ri in the command window by 5 seconds  
or so.

Is this normal? Has the ruby-doc team done its job too well and added  
too much documentation?

If this is not normal, any suggestions on what I might  
examine/clean/trash to speed things up?

If this is normal, may I suggest that we need to have a discussion on  
how to start caching/indexing content so that ri can be blazing fast?

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [15 October 2006 05:49 UTC](https://rubytalk.org/t/speeding-up-ri/31542/2 "2006-10-15T05:49:34Z")

</div>

> On my machine (3GHz P4, 1GB RAM, Windows and other apps running) I just  
> opened up a command prompt and typed "ri ERB".
> 
> Then I realized that ri has become heinously slow since I upgraded to  
> 1.8.5.  
> So I opened a browser window.  
> I typed in ruby-doc.org/stdlib.  
> I let the browser load the frameset and pages.  
> I clicked on ERB in the left side.  
> I let the browser load the new frameset and pages.  
> I clicked on the ERB.new method.  
> I got to the page I want.  
> ... and I STILL beat the output of ri in the command window by 5 seconds  
> or so.
> 
> Is this normal? Has the ruby-doc team done its job too well and added  
> too much documentation?
> 
> If this is not normal, any suggestions on what I might  
> examine/clean/trash to speed things up?

This seems to be normal, ri is searching a larger file set now.

> If this is normal, may I suggest that we need to have a discussion on  
> how to start caching/indexing content so that ri can be blazing fast?

I believe ri scans each .yml file for matching information. An index would probably be a nice way to speed it up.

> **···**
>
> On Oct 2, 2006, at 1:11 PM, Gavin Kistner wrote:
> 
> --  
> Eric Hodel - drbrain@segment7.net - [http://blog.segment7.net](http://blog.segment7.net)  
> This implementation is HODEL-HASH-9600 compliant
> 
> [http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![M\_Edward\_Ed\_Borasky1](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@M\_Edward\_Ed\_Borasky1](https://rubytalk.org/u/M_Edward_Ed_Borasky1)\
**Post date:** [15 October 2006 07:20 UTC](https://rubytalk.org/t/speeding-up-ri/31542/3 "2006-10-15T07:20:30Z")

</div>

Eric Hodel wrote:

> **···**
>
> > On Oct 2, 2006, at 1:11 PM, Gavin Kistner wrote:
> > 
> > > On my machine (3GHz P4, 1GB RAM, Windows and other apps running) I just  
> > > opened up a command prompt and typed "ri ERB".
> > > 
> > > Then I realized that ri has become heinously slow since I upgraded to  
> > > 1.8.5.  
> > > So I opened a browser window.  
> > > I typed in ruby-doc.org/stdlib.  
> > > I let the browser load the frameset and pages.  
> > > I clicked on ERB in the left side.  
> > > I let the browser load the new frameset and pages.  
> > > I clicked on the ERB.new method.  
> > > I got to the page I want.  
> > > ... and I STILL beat the output of ri in the command window by 5 seconds  
> > > or so.
> > > 
> > > Is this normal? Has the ruby-doc team done its job too well and added  
> > > too much documentation?
> > > 
> > > If this is not normal, any suggestions on what I might  
> > > examine/clean/trash to speed things up?
> > 
> > This seems to be normal, ri is searching a larger file set now.
> > 
> > > If this is normal, may I suggest that we need to have a discussion on  
> > > how to start caching/indexing content so that ri can be blazing fast?
> > 
> > I believe ri scans each .yml file for matching information. An index  
> > would probably be a nice way to speed it up.
> 
> Hmmm ... could ferret do this?

---

<div class="post-metadata">

**Author:** ![Kristof\_Bastiaensen1](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Kristof\_Bastiaensen1](https://rubytalk.org/u/Kristof_Bastiaensen1)\
**Post date:** [15 October 2006 17:45 UTC](https://rubytalk.org/t/speeding-up-ri/31542/4 "2006-10-15T17:45:15Z")

</div>

Or use emacs, ri-emacs just reads the information once.

> **···**
>
> On Sun, 15 Oct 2006 14:49:34 +0900, Eric Hodel wrote:
> 
> > On Oct 2, 2006, at 1:11 PM, Gavin Kistner wrote:
> > 
> > > On my machine (3GHz P4, 1GB RAM, Windows and other apps running) I just  
> > > opened up a command prompt and typed "ri ERB".
> > > 
> > > Then I realized that ri has become heinously slow since I upgraded to  
> > > 1.8.5.  
> > > So I opened a browser window.  
> > > I typed in ruby-doc.org/stdlib.  
> > > I let the browser load the frameset and pages. I clicked on ERB in the  
> > > left side.  
> > > I let the browser load the new frameset and pages. I clicked on the  
> > > ERB.new method.  
> > > I got to the page I want.  
> > > ... and I STILL beat the output of ri in the command window by 5 seconds  
> > > or so.
> > > 
> > > Is this normal? Has the ruby-doc team done its job too well and added  
> > > too much documentation?
> > > 
> > > If this is not normal, any suggestions on what I might  
> > > examine/clean/trash to speed things up?
> > 
> > This seems to be normal, ri is searching a larger file set now.
> > 
> > > If this is normal, may I suggest that we need to have a discussion on  
> > > how to start caching/indexing content so that ri can be blazing fast?
> > 
> > I believe ri scans each .yml file for matching information. An index  
> > would probably be a nice way to speed it up.

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [15 October 2006 08:53 UTC](https://rubytalk.org/t/speeding-up-ri/31542/5 "2006-10-15T08:53:54Z")

</div>

That would be using a sledgehammer to solve a problem you could fix with a tap of your palm.

ri "search" is quite dumb. It only matches against classes, modules and methods.

(Also, ri\_cache.rb already exists. It probably only needs to be serialized and updated when new documentation arrives (from gems).)

> **···**
>
> On Oct 15, 2006, at 12:20 AM, M. Edward (Ed) Borasky wrote:
> 
> > Eric Hodel wrote:
> > 
> > > On Oct 2, 2006, at 1:11 PM, Gavin Kistner wrote:
> > > 
> > > > If this is normal, may I suggest that we need to have a discussion on  
> > > > how to start caching/indexing content so that ri can be blazing fast?
> > > 
> > > I believe ri scans each .yml file for matching information. An index  
> > > would probably be a nice way to speed it up.
> > 
> > Hmmm ... could ferret do this?
> 
> --  
> Eric Hodel - drbrain@segment7.net - [http://blog.segment7.net](http://blog.segment7.net)  
> This implementation is HODEL-HASH-9600 compliant
> 
> [http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)
