Helper Searching

Hey –

The testing setup we’re using has a lot of helper scripts. Enough that search time is a signifigant issue as we’re not calling most of them with absolute paths. Thus far we’ve pretty much made them all available and let Eggplant search for the one it needs. And this works, but as we get more helpers, some things get slower.

I’m curious if it is stated somewhere how Eggplant searches through all the possible helper scripts. I’m guessing it would be …

For script X:

  1. Search all scripts that are part of the suite that X is in
  2. Search all helpers in sequential order (how they’re listed) of the suite X belongs to. (But don’t recurse down into these yet? Is this true?)
  3. If the script we’re seaching for isn’t in the initial helpers, then search through the helpers of the helpers – going down one more level … again sequentially?

Am I at all correct about how this works? Again, since I’m dealing with so many helpers, having this sort of thing organized properly is a big speed savings … which is why I’m concenred.

Thanks –
Chris.

Hi, Chris:

I’m going to let one of the developers address your questions about the order in which Eggplant looks for scripts/handlers/objects. I can tell you that in Eggplant 1.5, adding helpers will cause some slowdown in the execution of your scripts. This is due to the fact that we added some flexibility in the way that you can specify properties of objects, and that requires Eggplant to look at more things when what is being asked for is ambiguous. “What makes something ambiguous?”, you’re probably asking. Well, here’s an example that recently came to our attention:

put the length of "abc"

This could refer to one of four things:

  1. a property called length of an object called “abc”
  2. a function called length that is defined in an object called “abc”
  3. a “getProp length” handler of object “abc”
  4. the SenseTalk function length() with a string argument of “abc”

When it encounters this syntax, Eggplant looks for these things in the order specified above, so the more Helpers you have, the more places there are for Eggplant to look. If you have any commands that look like this and what you intend is option #4, your script will run much faster if you use the function call syntax:

put length("abc")

This tells Eggplant that you want to know the length of string “abc” and it won’t look for any of the other options mentioned above.

We’ve added some optimizations to the next version of Eggplant that will eliminate much of the slowing that you might see in Eggplant 1.5, but until that version is released, minimizing the number of helpers you have and watching for the “ambiguous” syntax that causes the searches to occur are your best defenses.

Chris:

We have done some work for Eggplant 1.6 that should reduce the time Eggplant spends looking for the right script to call.

As far as the priority that Eggplant searches Helper Suites it goes like this.

  1. First Eggplant searches for scripts/images in the current suite.

  2. Starting with the first helper in the list (including helpers opened using the openSuite command) Eggplant will see if that suite has a script/image, if not it will look in all of its Helpers BEFORE going to the next helper in the list, each of those will descend - depth first, looking for the script/image that you are trying to find.

Hopefully that is clear enough to allow you to predict where Eggplant will resolve a particular resource when it’s asked for.

Yeah, that’s great – thanks. I think I managed to determine that on my own after a few more experiments. It only seems to be an issue when you really get a lot of scripts … perhaps in the thousands. But, that’s what we’re dealing with.

I’ve heard about v1.6 a few times … any idea when that version is going to appear?

  • Chris.

We don’t have a firm release date at this time. I can say that we are hard at work on it and hope to have a Beta release available soon. For anyone that would like to be included on the Beta list for Eggplant please send an email to support@redstonesoftware.com.