RIAForge Forums Home | Search | RSS
New Topic Reply   Previous Page  Page: 1   Previous Page

Thread: Speed...
Created on: 04/09/08 09:07 AM Replies: 1

Joined: 01/09/07
Posts: 5
04/09/08 9:07 AM

This is one of those abstract features. When using coldmock, my test were executing in 30 ms. With easymock, the same test are taking between 3000-5000 ms.

Not, obviously there is going to be a performance hit for the verification process and there are a LOT more object created in easymock. So it should be slower, the question is really how slow is acceptable. My first test cfc contains 10 tests. It takes over 30 secs to run. To me, that's not very scalable. With that metric, a test suite of 500 cases would take 1500 secs (25 min).

It seems the overhead is in two places. First in the creation of all the cfcs and second in the mixin method (in reflect.Proxy). I'm not sure what can be done about the first other than to see where a struct may suffice for a cfc internal to easymock.

The second issue is difficult as well because there is no way to instantiate a cfc without it being written to disk first. Since each method proxy is a cfc, that mean a file read/write for every method of each mock. Pretty costly.

Right now, I'm excited about the functionality of easymock and want to help get it solid. However optimization for speed will be a critical piece of wider acceptance.

Just throwing this out there to chew on. Keep up the good work Mike!

Link | Top | Bottom

Joined: 03/27/08
Posts: 5
RE: Speed...
04/10/08 5:38 PM

I definitely agree. The primary issue with CFEasyMock it the first version works on CF7. That means the onMissingMethod() function isn't available. To counteract this, the reflect package is writing out the methods and doing a mixin. This is where the speed hit occurs.

Once I get the unit tests completed, I'm going to refactor the reflect package to CF8, so you should see a speed increase.
Link | Top | Bottom

New Post
Please login to post a response.