The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
FastRI: faster RI docs for Ruby, across machines - one Ring to find them (via DRb + Rinda)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eigen Class

Posts: 358
Nickname: eigenclass
Registered: Oct, 2005

Eigenclass is a hardcore Ruby blog.
FastRI: faster RI docs for Ruby, across machines - one Ring to find them (via DRb + Rinda) Posted: Oct 31, 2006 11:55 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Eigen Class.
Original Post: FastRI: faster RI docs for Ruby, across machines - one Ring to find them (via DRb + Rinda)
Feed Title: Eigenclass
Feed URL: http://feeds.feedburner.com/eigenclass
Feed Description: Ruby stuff --- trying to stay away from triviality.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eigen Class
Latest Posts From Eigenclass

Advertisement

Never felt that ri is way too slow? It was never very fast, but it's become worse as of late, since it also searches the RI documentation in your RubyGems packages...

eban recently proposed a shell script to cache the results:

 #! /bin/sh
 
 cachedir=$HOME/.fri
 mkdir -p $cachedir
 args="$@"
 cachename=$cachedir/"$(echo -- $args | md5sum | cut -d' ' -f1)"
 if [ ! -e $cachename ]; then
   ri -T "$@" > $cachename
 fi
 ${PAGER-less} $cachename

It's handy for frequently consulted methods, but it doesn't make new lookups any faster.

I've written FastRI, a DRb-enabled, fast alternative to ri. It is *much* faster, and also allows you to access RI over DRb.

 $ time ri -T Sexp
 [...]
 real	0m0.901s
 user	0m0.752s
 sys	0m0.112s

vs.

 $ time fri Sexp
 [...]
 real	0m0.068s
 user	0m0.052s
 sys	0m0.000s

FastRI consists of a server (fastri-server) that provides the RI lookup service, and the client (fri) which will locate the server automatically and obtain the requested documentation via DRb.

Since fastri-server is running in the background, it will not have to search all your documentation directories on each request. This makes it much faster*1 than plain old ri.

FastRI uses a Rinda Ring to allow the server to be discovered automatically without needing to indicate the DRb URI manually. It can work also across machines, so you could run the server in one machine and use fri in several hosts across your network.

Getting it


Read more...

Read: FastRI: faster RI docs for Ruby, across machines - one Ring to find them (via DRb + Rinda)

Topic: Yukihiro "Matz" Matsumoto: Ruby Design Principles Previous Topic   Next Topic Topic: Ruby isn't going to fracture, and

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use