Optomizing/caching simpletest?

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Optomizing/caching simpletest?

Post by nielsene »

I think something is wrong. The tests seem to take about 2 minutes to run, regardless of the number of tests cases (1 single runner versus the top level All.php). The application itself loads almost instantaneously.

Looking at the process monitor I see that I have 1.5GB of free RAM, and processor load is about 30% on one processor, other processor is basically un-touched. I'm running locally on a Dual 2.7GHz PowerMac with 2.5GB RAM.

Any idea as to what's causing the overhead with simpletest? (I could understand if there were an appreciable difference between single test versus all tests that the reflection for finding test methods could be slightly slow, but it should scale....)
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Two minutes is a long time - A large group test might take a while but single test runners should be very quick.

I'm afraid I'm not sure what could be causing this.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

As with anything that takes a long time... Try profiling it!
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

I hate heisenbugs.... Add calls to micro-time it takes ~10 seconds for the full set of non-web tests. Remove the timing calls it goes back to over a minute... Might just leave the timing calls in as it seems to help -- but its not just a perception thing. Timed it 10 times on each with a psuedo-random order to avoid cacheing type effects.

All the time is inside the run (as expected) so file parsing/including isn't a problem and no funny loops happening.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Ow, that's icky. Have you tried to use a non PHP-based profiler like APD?
Post Reply