Slow replay of scripts in Flex3

August 26, 2009 at 5:55 am 10 comments

 

In Flex3, if the application has lot of component in under one control the replay is observed to be slow. I will explaining what causes this and what the developers can do to over come this, till they are ready to migrate to Flex4 which completely addresses this issue.

What causes this problem?

A lot of controls under one container?  what is meant by this in automation terms ?

1. The application has a container which has lot of controls directly placed under the same.  e.g under one panel, user placing a lot of controls , i,e one container has 100 buttons, 200 text input etc.  I doubt anybody will do such a thing.

2. The container has lot of controls indirectly placed under the same.  i.e assume that there is a custom control which comprises of 100 + components and from a container user uses multiple instances of this custom control. Possible , isn’t it?

3. A container has lot of controls unknowingly placed under the same. I think this is most common scenario as it happens without the mistake of the application developer.  Assume a canvas has lot of controls and the user has placed them appropriately in HBoxes and VBoxes.  So no container has really not many children.  But this also will unknowingly cause a lot of children under the same container.

 Assume the user has an application structure as follows.

 Application structure

 Her no contianer has more than 4 chilren.

Cavas has children of HBox1, C6,C7 and VBox1.

Similarly HBox1 has C1-C4, VBox1 has VBox2, HBox2 and C8.

So ideally the hierachy of C12 will be Application->Canvas->VBox1->VBox2->C12.

But for automation, to make the scrtipts shorter, the Boxes are made not visible in the automation hierarchy.  So in this case all controls from C1-C14 will be the children of the Canvas.

So the user inteaction on C12 will be recorded as

Application->Canvas->C12.

i.e th automation hierarchy will be as follows.

 

Automation Heirarchy

Automation Heirarchy

This kind of scenario makes one container have a lot of children them for automaton even though user cannot see that in his application code.

What can be done ?

In flex4 automation framework the performance issue is addressed. So even if the user have a lot of controls under one container, replay should be considerably faster.

Till then user can reduce the children of  the canvas and make them the children of making ‘visibleInAutomationHeirachy’ property true to the HBoxes and VBoxes.

So they will have the same structure as that of the logical relationship for automation also. 

Assume user made VBox1 visible in automation hierarchy, children of canvas will be 7 (i.e C1- C7 and VBox1)

C8 – c14 will be children of VBox1 in that case.

if the user made VBox2 visibleInAutomationHierarchy true,  VBox1 children will be VBox2, c8-C11

So user can decide the appropriate Boxes and make them visible to automation , so that children under container will not be many.

Please note that, the script needs to be rerecorded with the new automation hierarchy.

Advertisements

Entry filed under: Flex Automation, Flex Automation.

Custom Component Automation – XML Details Custom component Automation – Introduction

10 Comments Add your own

  • 1. Tigran Najaryan  |  September 24, 2009 at 12:53 pm

    Hi Rani, didn’t know you have a blog! Actually if Matt Chotin did not mention about your blog in his recent post I would never know. Subscribed now! 🙂

    A late question on topic: how exactly does Flex 4 address the performance problems of automation framework?

    Performance issues are very noticeable for components which have lots of children e.g. DataGrid with 20 columns and 50 rows has 1000 children.

    I’d be highly interested to know what changes in Flex 4 automation address this.

    Reply
    • 2. raniskumar  |  September 24, 2009 at 2:10 pm

      Hi,
      Thanks to Matt 🙂

      About Performance improvement in Flex4 : It is very internal to Automation Manger. There is a process in Automation Manager which tries to resolve a child in a parent based on the partID of the child. (Basically the information mentioned in the object identifiction during replay). Here one of the property is automation Index. So for matching a child this was calculated for all children in a contianer. And even to get the properties on an object, the idPart is formed. So the calculation of the automationIndex happens n times for one part matching. In flex4 we optimized this by delaying the index calculation to the last, i.e only if all other things match, we do this calculation. And added a new interface in Automation Object which enables the property calculaiton once.
      You can refer to function createAutomationIDPartWithRequiredProperties(child:IAutomationObject, properties:Array):Object; and scoreChild are the main affected functions in this context.
      Another change is introuction and usage of function getAutomationChildren():Array; in IAutomationObject instead of numAutomationChildren and getAutomationChildAt where the children are calcuated for every request of the child in the loop.

      You can get details about the performace improvement figures in http://bugs.adobe.com/jira/browse/FLEXENT-749

      Your feedback is always appreciated 🙂

      Reply
      • 3. Tigran Najaryan  |  September 24, 2009 at 2:26 pm

        Delayed calculation of automationIndex makes perfect sense, thanks for details.

        getAutomationChildren() that returns an array is a welcome addition. (I cannot see it in Flash Builder help for IAutomationObject, so I guess it is not yet available publicly).

        I cannot seem to access FLEXENT-749, it is probably a private issue.

        This is all good news anyway. Note to myself: spend some time experimenting with this new stuff. 🙂

      • 4. guydipietro  |  March 24, 2010 at 7:54 pm

        Hi Rani,

        I appreciate the description of the fix available in Flex 4.0. I was wondering if it would be possible to compile an application built with Flex 3.2 with the Flex 4.0 automation libraries? The reason I ask this is the development team is averse to upgrading to Flex 4 as they will need to update a lot of code in order to accomplish this. I’m finding extremely slow replay on our pages that use FlexDataGrids. Specifically we have seen slow replay with a grid that has 20 rows, each row containing a flex box with another 20 objects within it.

  • 5. Tigran Najaryan  |  September 24, 2009 at 1:07 pm

    Hi Rani, didn’t know you have a blog! Actually if Matt Chotin did not mention about your blog in his recent post I would never know. Subscribed to your blog now! 🙂

    A question on topic: how exactly does Flex 4 address the performance problems of automation framework?

    Performance issues are very noticeable for components which have lots of children e.g. DataGrid with 20 columns and 50 rows has 1000 children.

    I’d be highly interested to know what changes in Flex 4 automation address this.

    Reply
  • 6. JabbyPanda  |  September 30, 2009 at 3:17 pm

    Cannot access http://bugs.adobe.com/jira/browse/FLEXENT-749 issue, althought I am registered Adobe JIRA user.

    Reply
  • 8. Vishal  |  May 18, 2010 at 7:19 pm

    Hi Rani,
    I must say an extremely helpful blog.
    Have a question that has been asked above
    Will compiling the Flex 3.2 code with Flex 4.0 libraries help to resolve or atleast make the performance better ?

    Reply
    • 9. raniskumar  |  June 10, 2010 at 10:19 am

      Both sdk and automation libraries should be of the same version. So i will recommend to use flex 4 sdk and flex 4 automation and have the project setting as mx only with compatability which gives the best compatability of 3 code with 4 sdk.

      Reply
  • […] &    Slow replay of scripts in Flex 3 […]

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

August 2009
M T W T F S S
« Jul   Sep »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Most Recent Posts


%d bloggers like this: