[rspec-devel] auto-generated descriptions

Pat Maddox pergesu at gmail.com
Fri Jul 4 18:20:21 EDT 2008


On Fri, Jul 4, 2008 at 1:45 PM, David Chelimsky <dchelimsky at gmail.com> wrote:
> Hey all,
>
> I'm looking for ways to optimize rspec and came upon something interesting.
> If I remove handling for auto-generated descriptions (the thing that allows
> you to say "specify { 5.should == 5 }" with no description string) we get an
> average 35% performance increase per expectation. 35%. That's huge.
>
> So - how bad do you think this would suck to remove that feature? Are you
> using it yourself?
>
> All thoughts welcome.

To be clear, this is for taking a spec like:

it { 2.should == 2 }

and then when running with the specdoc formatter, getting

- should == 2

I personally don't use specdoc format very often anyway.  My intuition
is that writing specs without a description (which I frequently use)
is optimized for programmer clarity, so auto-generating a description
for it is less important.  I understand that the description would be
used in a number of other places, including error messages, but in the
case of error messages I just use line numbers.

Basically, auto-generating descriptions are valuable, but fall way
short of withholding a 35% performance improvement.

Pat


More information about the rspec-devel mailing list