[Rake-devel] Rake DSL Commands are no long in top level
Patrick.Bennett at inin.com
Fri Jun 5 10:52:11 EDT 2009
While I still find it disturbing that comments in code will be assumed to be task comments, if the performance impact is only there if an option is specified requesting task descriptions then my performance concerns are definitely lessened.
Still - how is that desc - something that does nothing more than setting a string, take more time more than reading a file (a bunch of two line files isn't the best test, but you did actually test something so I can't complain too much ;>) and running a regexp parse across the caller backtrace? That really doesn't make any sense Jim.
Speaking of the patch - how does it handle it when multiple tasks are created on the same line [say in a block iteration]? If there happens to be a comment on the line above they'll all get the same task description?
From: rake-devel-bounces at rubyforge.org [mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Jim Weirich
Sent: Friday, June 05, 2009 10:39 AM
To: Rake Development and Discussion
Subject: Re: [Rake-devel] Rake DSL Commands are no long in top level
On Jun 4, 2009, at 7:51 PM, Dave Thomas wrote:
> But perhaps some real numbers, rather than some genuine concerns,
> would give
> us the data to go on.
So, here are some numbers. This is based on 30,000 tasks split into
300 files. The tasks do nothing but declare a single dependency.
This is against the latest code base that does not do task metadata
recording (i.e. comments and line numbers) unless a -T, -D or -W
option is given.
# USING DESC
[env*]$ time ruby -I../lib ../bin/rake -Rdesc
# USING RUBY COMMENTS
[env*]$ time ruby -I../lib ../bin/rake -Rcomment
# WITH NO COMMENTS
[env*]$ time ruby -I../lib ../bin/rake -Rnone
Turns out the comment version is actually faster (because I'm not
processing the desc command). I imagine the speed of the desc version
could be improved if I made it obey the no task metadata flag.
Running with the -T (and piping all output to /dev/null) shows that
the comment version runs about 1/2 second slower than the desc version
(3.8 vs 3.3 seconds). Given that these cases will be primarily
dominated by the speed of the output, I'm not too worried about a slow
I don't see any performance reasons to take out Dave's patch.
-- Jim Weirich
-- jim.weirich at gmail.com
Rake-devel mailing list
Rake-devel at rubyforge.org
More information about the Rake-devel