Re: [rspec-users] auto-generated descriptions

2008-07-07 Thread David Chelimsky

On Jul 7, 2008, at 1:47 PM, Ashley Moran wrote:



On Jul 04, 2008, at 9:45 pm, David Chelimsky wrote:

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?


I was aware of it but never felt the need to use it


Thanks to everyone for the feedback.

I've come up w/ a good compromise solution which is to only generate  
the description when it's actually used. Just required moving the call  
to generate the description to a different place.


Cheers,
David
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] auto-generated descriptions

2008-07-07 Thread Ashley Moran


On Jul 04, 2008, at 9:45 pm, David Chelimsky wrote:

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?


I was aware of it but never felt the need to use it

Ashley


--
http://www.patchspace.co.uk/
http://aviewfromafar.net/

___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] auto-generated descriptions

2008-07-07 Thread Zach Dennis
On Fri, Jul 4, 2008 at 10:18 PM, Steve Eley <[EMAIL PROTECTED]> wrote:

> On Fri, Jul 4, 2008 at 4:45 PM, David Chelimsky <[EMAIL PROTECTED]>
> wrote:
> >
> > So - how bad do you think this would suck to remove that feature? Are you
> > using it yourself?
>
> I'm not, but would it be impractical to extract it out into some sort
> of module or helper and tell people to include it in their config.*
> block if they want to use it?
>

+1


-- 
Zach Dennis
http://www.continuousthinking.com
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] auto-generated descriptions

2008-07-05 Thread Yi Wen
+1. This is a smart.

On Fri, Jul 4, 2008 at 9:18 PM, Steve Eley <[EMAIL PROTECTED]> wrote:
> On Fri, Jul 4, 2008 at 4:45 PM, David Chelimsky <[EMAIL PROTECTED]> wrote:
>>
>> So - how bad do you think this would suck to remove that feature? Are you
>> using it yourself?
>
> I'm not, but would it be impractical to extract it out into some sort
> of module or helper and tell people to include it in their config.*
> block if they want to use it?
>
>
> --
> Have Fun,
> Steve Eley
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] auto-generated descriptions

2008-07-04 Thread Scott Taylor


On Jul 4, 2008, at 10:54 PM, Mikel Lindsaar wrote:

On Sat, Jul 5, 2008 at 12:18 PM, Steve Eley <[EMAIL PROTECTED]>  
wrote:
On Fri, Jul 4, 2008 at 4:45 PM, David Chelimsky  
<[EMAIL PROTECTED]> wrote:
So - how bad do you think this would suck to remove that feature?  
Are you

using it yourself?

I'm not, but would it be impractical to extract it out into some sort
of module or helper and tell people to include it in their config.*
block if they want to use it?


+1

config.enable_auto_generating_descriptions = true

35% is 35%...

Mikel



I would think autoloading rspec (with Module#autoload) would be a big  
speed up for features that aren't used...


Besides - where are the benchmarks?

Scott

___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] auto-generated descriptions

2008-07-04 Thread Mikel Lindsaar
On Sat, Jul 5, 2008 at 12:18 PM, Steve Eley <[EMAIL PROTECTED]> wrote:
> On Fri, Jul 4, 2008 at 4:45 PM, David Chelimsky <[EMAIL PROTECTED]> wrote:
>> So - how bad do you think this would suck to remove that feature? Are you
>> using it yourself?
> I'm not, but would it be impractical to extract it out into some sort
> of module or helper and tell people to include it in their config.*
> block if they want to use it?

+1

config.enable_auto_generating_descriptions = true

35% is 35%...

Mikel

-- 
http://lindsaar.net/
Rails, RSpec, Puppet and Life blog
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] auto-generated descriptions

2008-07-04 Thread Ben Mabey

David Chelimsky 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.

Thanks,
David
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


David,
I personally like that feature, but I honestly don't find myself using 
it too much.  35% is a lot.


One suggestion would be to keep the functionality but move it to a 
different keyword so that the common "it"/"specify" case is made 
faster.  That way we could have our cake and eat it too.  I'm not too 
sure on what keyword could be used though.  "Expect" comes to mind but I 
think that is because of Jay Fields expectations framework.  Which, BTW, 
if we added support for that to coexist within rspec example groups then 
the need for rspec to support the feature natively would diminish.  So 
that is another option that may be worth investigating.


Could you maybe post the diff of your changes to turn off that feature?  
I'd be interested in seeing how much speed improvements I get with my 
slower spec suites.


Thanks,
Ben
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] auto-generated descriptions

2008-07-04 Thread Steve Eley
On Fri, Jul 4, 2008 at 4:45 PM, David Chelimsky <[EMAIL PROTECTED]> wrote:
>
> So - how bad do you think this would suck to remove that feature? Are you
> using it yourself?

I'm not, but would it be impractical to extract it out into some sort
of module or helper and tell people to include it in their config.*
block if they want to use it?


-- 
Have Fun,
Steve Eley
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] auto-generated descriptions

2008-07-04 Thread Avdi Grimm
On Fri, Jul 4, 2008 at 4:45 PM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> So - how bad do you think this would suck to remove that feature? Are you
> using it yourself?

Personally, I *love* this feature, and would not like to see it go.
One of my heuristics for a good spec is that it either a) has a clear
spec doc string; or b) auto-formats to a clearly understandable doc
string.  I run spec -fs periodically to verify this.  The fact that I
can I can write a sizable subset of my specs in a very DRY way thanks
to the auto-formatting feature is one of my favorite little perks of
using RSpec.

-- 
Avdi

Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] auto-generated descriptions

2008-07-04 Thread Matt Darby

On Jul 4, 2008, at 4:45 PM, David Chelimsky wrote:


So - how bad do you think this would suck to remove that feature?  
Are you using it yourself?


All thoughts welcome.


Wasn't even aware that feature existed!
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


[rspec-users] auto-generated descriptions

2008-07-04 Thread David Chelimsky

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.

Thanks,
David
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users