[rspec-users] != again

Scott Taylor mailing_lists at railsnewbie.com
Sun Jun 1 22:13:46 EDT 2008


On Jun 1, 2008, at 4:55 PM, David Chelimsky wrote:

> On Jun 1, 2008, at 12:17 PM, Matthias Hennemeyer wrote:
>
>> Hey!
>>
>> I have implemented a quick solution for the should != .. , should ! 
>> ~ ... 'problem'.
>> It uses source code inspection (I think it's the only way) and i've  
>> done some
>> benchmarking to see if it's really that slow.
>>
>> A direct comparison of
>> running '1.should == 1'
>> with the unmodified rspec source against the rspec-version with  
>> source inspect
>> shows that the latter is 7 times slower ... :(
>>
>> But benchmarks with '1.should == 1' inside a real example file are   
>> showing 'only'
>> an overall speed decrease of 15% to 50%. That is still bad but  
>> having lots of people
>> consider the passing of '1.should != 1'  an rspec bug is bad too.
>
> RSpec is already getting dinged for being slower than test/unit.  
> Making it run any slower than it already does is a deal breaker for  
> me.

Maybe using autoloading instead of requiring would help the situation?

It seems perfectly reasonable that rspec is bigger than test/unit:  
Test::Unit doesn't have a mocking framework, and so on.  On the other  
hand, if no one uses (rspec's) mocking framework, should rspec have  
the code in place anyway?

Anyway - I've never found it to be too slow.  Has anyone done  
benchmarks on it?

Scott


>
>
>> Here is the benchmarking script:
>> http://pastie.caboo.se/206853
>>
>> And the code is at branch 'inspect' in:
>> git://github.com/mhennemeyer/rspec
>>
>> There are examples for should and should_not != and !~ and i will
>> definitely work on performance if you not totally reject this whole  
>> idea.
>
> If you can get the performance up to or better than current, I'm all  
> for it.
>
> Cheers,
> David
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list