Roundup of new RubyGems features

G

Gavin Sinclair

Hi folks,

I just noticed Chad's blog about the release of RubyGems 0.3.0.

http://www.chadfowler.com/index.cgi/Computing/Programming/Ruby/RubyGemsSecondRelease.rdoc,v

I'm just mentioning it here because I'd like to see some opinions
posted about the features, how well it works, and what needs to be
done.

Anybody who has ever wanted to be able to install a Ruby package
easily and automatically should give it a go, even if there are no
particular packages they want at the moment. It's easy and
reversible.

See http://rubygems.rubyforge.org/wiki/wiki.pl?GemReference (bottom of
page) for example command-line incantations.

Cheers,
Gavin
 
C

Charles Comstock

Gavin said:
Hi folks,

I just noticed Chad's blog about the release of RubyGems 0.3.0.

http://www.chadfowler.com/index.cgi/Computing/Programming/Ruby/RubyGemsSecondRelease.rdoc,v

I'm just mentioning it here because I'd like to see some opinions
posted about the features, how well it works, and what needs to be
done.

Anybody who has ever wanted to be able to install a Ruby package
easily and automatically should give it a go, even if there are no
particular packages they want at the moment. It's easy and
reversible.

See http://rubygems.rubyforge.org/wiki/wiki.pl?GemReference (bottom of
page) for example command-line incantations.

Cheers,
Gavin

I was reading about how you did the executable by making a fake file to
load in others. I never used rake without rubygems but I noticed it
definitely had a slow startup time. Could this be related to that?
There is a definite noticeable pause between typing rake and getting the
first line of output, or even --help options.
Charles Comstock
 
J

Jim Weirich

Charles said:
I was reading about how you did the executable by making a fake file to
load in others. I never used rake without rubygems but I noticed it
definitely had a slow startup time. Could this be related to that?
There is a definite noticeable pause between typing rake and getting the
first line of output, or even --help options.

It is more likely that the cause of a slow rake startup is the time it
takes to calculate any filelists used for dependency detection. For
example, the filelist used for the clean target searches your entire
project tree looking for files that can be deleted. An obvious
optimization would be to delay the creation of a filelist until we
really need it.

If slow startups are a problem, I'll look into some possible fixes.
 
G

Gavin Sinclair

It is more likely that the cause of a slow rake startup is the time it
takes to calculate any filelists used for dependency detection. For
example, the filelist used for the clean target searches your entire
project tree looking for files that can be deleted. An obvious
optimization would be to delay the creation of a filelist until we
really need it.
If slow startups are a problem, I'll look into some possible fixes.

I've noticed this problem with rake for a long time, and it means I
don't use it for simple things (for which a slow startup is
unacceptable). Putting file lists inside methods is one way to get
some cheap lazy evaluation I think...

Gavin
 
J

Jim Weirich

(cross posted to Ruby Talk and Rake-devel)

Jim said:
It is more likely that the cause of a slow rake startup is the time it
takes to calculate any filelists used for dependency detection. For
example, the filelist used for the clean target searches your entire
project tree looking for files that can be deleted. An obvious
optimization would be to delay the creation of a filelist until we
really need it.

If slow startups are a problem, I'll look into some possible fixes.


Several people have indicated to me that the startup is a minor problem.
The following URL is for a experimental gem for rake that using
delayed filelists.

http://onestepback.org/software/rake/download/rake-0.3.2.2.gem

(NOTE: don't move this to a gem server until I get some feedback on
it, thanks)

FileLists (array-like objects that contain file names) are normally
built at the time they are declared. This can be quite expensive. For
example:

SOURCE_FILES = FileList['**/*.rb']

will search your entire project tree and find all the ruby source files
and add them to the SOURCE_FILES file list. If done at the top level of
a rakefile (and most are), this list will be done on every invocation of
rake (even if you say "rake --help").

In the experimental gem above, the building of the FileList is actually
delayed until the first time the data is required. If the file list is
used in a dependency calculation, you probably won't see any difference.
If the file list is only used in the body of a task (such as the CLEAN
list, which is a major offender), then this should speed things up a bit.

For those who have noticed slow starts, give this gem a try and let me
know if it helps or if it causes other problems.

Thanks!

Some GEM Instructions:

If you have rake installed as a gem, just download the URL above and do
a local gem installation (e.g. gem -Li rake-0.3.3.2.gem) and you can
start using it immediately. If you wish to uninstall it, then just do a
"gem -U rake" and select the 0.3.3.2 version. The previous gem
version of rake should be reestablished.

If you are not using the gem version of rake, than grab the latest CVS
and install it normally.
 
G

Gavin Sinclair

Several people have indicated to me that the startup is a minor problem.
The following URL is for a experimental gem for rake that using
delayed filelists. [....]


When I tried it at work, things seemed fantastically fast. Now at
home with (I guess) a chunkier Rakefile, versions 0.3.2 and 0.3.2.2
seem just as slow at running 'rake -T'.

Is 'rake -T' not a suitable test?

Thanks,
Gavin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top