Problem with "new Group()" performance

Hello
I need to create many spark.components.Group objects (more than 10000) and have some performance problem. In many cases new object was created in 0-5 ms, but sometimes in 266-700 ms.
This is output from my test app (code below):
[Time] - [Count]
0 - 91035
1 - 7308
2 - 393
3 - 365
4 - 408
5 - 404
6 - 66
7 - 3
8 - 3
9 - 2
10 - 1
12 - 1
13 - 1
16 - 1
19 - 1
24 - 1
39 - 1
63 - 1
67 - 1
210 - 1
260 - 1
266 - 1
690 - 1
And code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768" applicationComplete="windowedapplication1_applicationCompleteHandler(event)">
    <fx:Script>
    <![CDATA[
        import mx.events.FlexEvent;
        import spark.components.Group;
        private var container:Array = new Array();
        protected function windowedapplication1_applicationCompleteHandler(event:FlexEvent):void {
            var map:Object = new Object();
            var i:int, start:int, stop:int;
            var grp:Group;
            for(i = 0; i != 100000; i++) {
                start = new Date().getTime();
                grp = new Group();
                stop = new Date().getTime();
                if (!map.hasOwnProperty(stop - start)) {
                    map[stop - start] = 0;
                map[stop - start]++;
                container.push(grp);
            for (var key:* in map) {
                trace(key + " - " + map[key]);
    ]]>
    </fx:Script>
</s:Application>
Can you test this code in yours computers?
Anybody know where is a problem? I don't have any applications run in background. etc...
Testes on SDK: 4.0 (default in Flash Builder 4 b 2), 4.0 build 13875, 4.1 build 14741
Mariusz Dalewski

Here are my results with a few classes:
spark.components.Group:
0 - 87676
1 - 10563
2 - 340
3 - 346
4 - 349
5 - 480
6 - 222
7 - 6
8 - 4
9 - 1
10 - 1
11 - 1
76 - 1
13 - 1
14 - 2
16 - 1
12 - 1
407 - 1
472 - 1
26 - 1
94 - 1
31 - 1
mx.containers.Canvas:
0 - 79601
1 - 18534
2 - 287
3 - 258
4 - 284
5 - 383
6 - 328
7 - 243
8 - 42
9 - 11
130 - 1
11 - 2
324 - 1
13 - 2
14 - 3
10 - 3
18 - 1
12 - 9
21 - 1
741 - 1
504 - 1
27 - 2
28 - 1
351 - 1
mx.core.UIComponent:
0 - 89460
1 - 8748
2 - 337
3 - 382
4 - 317
5 - 527
6 - 209
7 - 3
8 - 2
9 - 3
42 - 1
99 - 1
12 - 1
462 - 1
14 - 2
15 - 1
116 - 1
118 - 1
124 - 1
30 - 1
31 - 1
Sprite:
0 - 98957
1 - 1030
2 - 1
5 - 11
6 - 1
spark.primitives.Rect:
0 - 99598
1 - 402
spark.primitives.supportClasses.GraphicElement:
0 - 99598
1 - 402
As Bonzo mentioned this doesn't seem to be a Group problem as Canvas also has some long times.  UIComponent is lighter than both Canvas and Group and it still has  a couple entries longer than a few ms.  Notice that using Sprite or GraphicElement is much faster.  GraphicElement is very lightweight, are you able to use it instead of a Group? 100,000 Groups seems like a lot, can you explain your use case, maybe there is a way to use virtual layout to minimize the number needed at any one time?
I think the container.push() call might be causing a lot of the delay, if you use:
private var container:Array = new Array(100000);
container[i] = grp;
You should see less large delay times.  It might be good to try using a Vector instead of an Array like Bonzo suggested too.

Similar Messages

  • Problem with new version 4.3.2 apps not working " after update to the new version "

    Problem with new version 4.3.2 apps not working " after update to the new version "
    i was in 4.3.1 then i do the update , but now after update i face this problem , so what i Supposed to do ?!!

    Hi There
    Had the same problem as you. App would terminate when launched.
    Solution to working You Tube app:
    -Go to playstore
    - Uninstall app (it doesn't remove the app, only removes the update)
    - "Et Voila", working again.
    This doesn't correct the problem, it's just a workaround for you to be able to use youtube app again.
    Hope it helped.
    Best Regards

  • Problem with checkbox group in row popin of table.

    In table row popin I have kept Check Box Group.I have mapped  the texts property of checkbox group to the attribute which is under the subnode of the table.the subnode properties singleton=false,selectioncardinality=0-n,and cardinality=0-n.
    if there are 'n' number of records in the table.each record will have its own row popin and in the row popin there is check box group.
    the check box group in the row popin  belongs to that perticular row.
    but the checkboxegroup values in row popins of all the  rows are getting changed to the row which is lead selected.
    The same scenario  (table in the row popin is showing the values corresponding to its perticular row and all the table values in popin are not getting changed to the one lead selected in the main table)is working fine with the table in place of  checkbox group in row popin with datasource property of table  binded to the subnode
    I cant trace out the problem with checkbox group in place of table.
    Please help me in this regard.I have to place check box group in place of table in row popin.
    Thanks and Regards
        Kiran Kumar K

    I have done the same thing successfully with normal check box ui element. Try using check box in your tabel cell editor instead of check box group.

  • I bought new i phone 5 3 days back, after that asked for new update which is 6.1.4, after updating my iphone i am not able to use cellular data services. I called up data provider, they says its the problem with new software update. There is no option add

    I bought new i phone 5 3 days back, after that asked for new update which is 6.1.4, after updating my iphone i am not able to use cellular data services. I called up data provider, they says its the problem with new software update. There is no option add APN. Now when i switch to safari its showing you are not subscribed for cellular data. But I am able to use data on other phone.
    Will you please help me in this regard?
    Another issue, since i bought my new iphone there is dust inside back main camera.
    Your advises are highly appreciated.

    Hey Shaiju isac,
    I'd take a look at the following article, it'll guide you though steps to you troubleshoot cellular data issues on your iPhone:
    iPhone: Troubleshooting a cellular data connection
    http://support.apple.com/kb/ts3780
    Cheers,
    David

  • Wifi problems with new ipad

    I'm trying to learn how to correct wifi problems with new iPad.  It is the wifi only, 64GB model.  I want to be able to use it at work, where we have a great wifi network.  I can usually connect to our network with no problem, but after an hour or so my iPad loses the network.  When I try to reconnect, I see that the network is showing full strength reception, but I get the error message from the iPad that I am "Unable to join" the network.  My iPhone connects to the same network seamlessly, as do all of the other iPhones of my co-workers and the older generation iPads that some of our staff has.
    At other locations, I typically have no problems (home, apple store, etc.) but I have had the same situation pop up at a coffee shop where I could see that there was a wifi network available, but I could not join it even though it was the shop's free wifi. 
    I have tried turning the iPad off, turning off wifi and turning it back on again, and forgetting the wifi network in question.  I can't think of any other methods that are available to an end user to correct the problem. 
    I have already gone to the Apple store to swap out the unit, and the newer one is having the same symptoms. 
    Can anyone offer any advice here?  This is quite frustrating.

    No problem! Have a read at this most interesting article which has special significance as regards your models!
    http://edition.cnn.com/2012/04/05/tech/gaming-gadgets/ipad-wi-fi-issues/index.ht ml
    However, I attach an extract from another thread for your perusal. You can disregard any suggestions/links you have already explored -
    created by Texas Mac Man in Using iPad - View the full discussion
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router &amp; then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Change the channel on your wireless router. Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
     Cheers, Tom ;)

  • List of Problems with new Web Mail

    List of Problems with NEW Web Mail :
    - At first doesn't open full page message list or retain full page as default setting, have to drag down bar
    - Only shows 20 message lines after “pulling down” the divider, screen partially empty until I scroll down.  It should show at least 26, preferably all available
    - After moving bar, bar moves back up after going back to inbox (not delete message) after reading a message, have to move it down again, and again...
    - Doesn't go to next message when delete message on screen is selected, no setting option for default to do this.
    - There is a drop down to select which folder to move a selected email to.  The initial display shows 7 usable choices, with the usual slider and arrow to show more choices.  The space on the slider clearly shows more choices are present (actually about 20 or so are there), but any attempt to use the slider or arrow to see more choices causes the drop-down to instantly disappear.  I can't move the selected field with arrow keys either.  I can select any of the visible 7 choices, and move an email to only one of the 7.  NOTE: This one works in both IE and Firefox, but if Verizon Webmail was fully web standard (see http://en.wikipedia.org/wiki/Web_standards) compliant it would also work in my preferred browser, Mozilla Seamonkey, the direct descendant of the original Mozilla browser.  Webmail should be FULLY web standard.
    - Occasionally a message will move from inbox to trash, without NO indication or command to move them.
    - Emails occasionally flash an error message and simply disappear - not to trash or other findable place, just disappear.  No time to read the error message either.
    - No way to set a whitelist for supposed spam emails, unless the whitelist for “Blocking” is the same.  Very unclear.
    - How can I switch my service back to the original, basic, email which works ok?  I know it’s still there, since some of my other accounts still access it!!!
    This seems my only way of getting this info direclty to the programming staff.  If it doesn't actually do this, will SOMEONE PLEASE FORWARD THIS MESSAGE TO THEM !?!  
    Thanks!

    vz_ric wrote:
    The majority of websites are set up the same way for all browsers. It's the software manufacturers responsibility to make their software compatible with websites, not the other way around. Otherwise everyone who has a website will have to make 10 different sites to work multiple browsers.
    Contrarily, it is Verizon's, as well as other companies like Verizon whose customer base uses a wide variety of web browsers, web page designers' responsibility to use only standard W3C-recognized code and not to use non-standard non-W3C-recognized code, e.g., Microsoft's Internet Explorer specific code, when designing their web pages. In my opinion based on my observations, Verizon's web page designers are too often guilty of using IE-specific code.

  • Adobe aftereffects is not working on os x maverics all updates...... is dis soft. will work on the new os x yosemite.??  y apple is nt working on dis problem wen users are facing problems with new os x .....

    Adobe aftereffects is not working on os x maverics all updates...... is dis soft. will work on the new os x yosemite.??  y apple is nt working on dis problem wen users are facing problems with new os x .....

    I suggest you contact Adobe tech support or their Mac forums for assistance.

  • Reposting this If your having problems with new Windows 8.1 do a full uninstall of all Apple

    Reposting this If your having problems with new Windows 8.1 do a full uninstall of all Apple iTunes programs but uninstall them in right order and then do restart of computer then reinstall newest iTunes and it will all be fixed up syncing problems or other problems this is thanks to Apple phone support

    What is your technical support question for these user to user technical support forums?

  • When Apple solve problems with new iTunes calendar sync with windows and outlook?

    When Apple solve problems with new iTunes calendar sync with windows and outlook?

    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    More Info here...
    Apple ID FAQs  >  http://support.apple.com/kb/HT5622
    If necessary...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Before I buy has there been any problems with new 27 iMacs?

    Before I spend my hard earned cash does anyone know if there has been any problems with new 27 iMacs?

    Hello richard from Folsom:
    Are you inside or outside?  (  I could not resist, I lived in Sactown).
    Anyway, advice is frequently worth what you pay for it, and mine is free.
    If you want it, buy it.  The posts above are right on the mark (except waiting is probably overly-cautious).  The best advice (from anamusic) is to buy the extended warranty - well worth the money.
    Barry 

  • Strange Problem with Code Groups / Codes

    Hey all, have a strange problem with Code Groups and Codes.
    Our data migration team accidentally loaded an early version of our catalog (code groups and codes) in to our 'Gold' configuration client. They then proceed to delete them all via transaction qs41. However, the code groups have been deleted, but not the codes.
    So, basically, no codes groups exist in table QPGR or QPGT but all the entries remain in QPCD with the assigment to code groups. The usage indicator is not set on the codes so why they did not get deleted with the codes groups is unknown.
    The issue that this is now causing us is that we can't recreate the codes groups with these codes assigned as the system thinks they already exist (via a check on table QPCD i would expect).
    Also, i have been unable to recreate what happened did in other clients... seems very strange.
    Any help appreciated.
    Cheers

    Ben,
    You could try SE11, and see if you can delete the records from there.. but I'm not hopeful...
    Otherwise you may need to write a quick ABAP program to delete the data base entries.
    PeteA

  • I just started using my iphone 5s. I have a problem with new incoming emails from my POP account. Why are they marked as read automatically even though I have not even opened them yet.

    I just started using my iphone 5s. I have a problem with new incoming emails from my POP account. Why are they marked as read automatically even though I have not even opened them yet.
    At first I thought it might be because I was using simultaneously my old iPhone 4S so it somehow realized the emails where being pushed to another device and the it marked as read, this has nothing to do since I have deleted the email account from the iPhone 4S

    Contact the email provider for assistance with their service.

  • Problems with dinamic group

    I migrate the messaing (6.1) and directory(5.2), in the directory migrate the user and group, but i have problems with a group, i send a mail and the user who have menbers no send the mail, and retunt the mail .... and said
    Direcci�n del destinatario: [email protected]
    Motivo: you are not allowed to use this list: [email protected]
    it a dinamic group

    Your group must have a restriction on it, that only certain users are allowed to send to the group. If you are not on that list, then you will be prevented from sending to the group/list.
    Why don't you examine the ldap entry for the group, and see what's in there?

  • Premiere Elements 13 , Problems with new text/titles

    Premiere Elements 13, bisher keine Probleme. Nachdem die Filmlänge etwa 15 Minuten beträgt immer größere Probleme Titel/texte einzugeben. Wartezeiten sind extrem lange oder Programm stürzt ganz ab.

    High ATR,
    Computer running on Widows 7 ,64 Bit System, Service Pack 1, Processor AMD Phenom(tm) X4 945 3.00 Ghz;RAM 8 GB
    Grafikkarte: NVIDIA GeForce 8800 GT
    If the video on the timeline is longer than 10 minutes the problem will be remarkable. The response times adding a title is getting longer(2-15 seconds).
    As the video is now 18 minutes the response time is after each action(resizing of letters or any changes of the text) up to 30 seconds or the program crashes completely.
    Project settings are the following:
    General HD 1080i; 29,97frames/second; Video:1920v 1080 H, 30 fps
    Video: maximale Bittiefe, Dateiformat i-frame only mpeg, Kompressor MPRG i-Frame, Standbilder optimieren
    The video is a mixture  of full HD videos 1920x 1080 .mov and pictures up to 4608x3456 pixels.
    When the program crashes I remarked that the main memory RAM(8Gb) was fully used by the premiere program. Might there be a problem?
    Thank you for your service.
    thomasd
    Von: A.T. Romano 
    Gesendet: Sonntag, 1. Februar 2015 23:55
    An: Thomas Deschler
    Betreff:  Premiere Elements 13 , Problems with new text/titles
    Premiere Elements 13 , Problems with new text/titles
    created by A.T. Romano <https://forums.adobe.com/people/A.T.+Romano>  in Premiere Elements - View the full discussion <https://forums.adobe.com/message/7151822#7151822>

  • Facebook problems with new macbook pro.

    Facebook problems with new macbook pro. I can't publish photo albums to timeline. I can't share items onto timeline. Photos I'm tagged in don't appear on my timeline. Any help?

    Yes! Been living in a hellish nightmare since Sept-Oct. Unlike you, however, Apple has been of no help. They say the iPad is unhackable, plist and crash reports are none of my business and who understands them anyway, their route tracing apps are probably not reliable. The best they could do was wipe the iPad clean. Lost photos they said would be in the cloud....
    Almost immediately was back in somebody's VPN, their remote controller, video, audio, working. Got the purple buddy for the first time today. I have been invaded, my iPad no longer feels like my own, I have lost thanksgiving, Christmas, new year trying to track down the invaders, signed up for a Cisco course, set/reset passwords.
    I don't know who else to contact... Or what next to do.
    I've read similar frustration in other posts, scattered around the support communities. Yours is the only one that has worked toward a solution.
    How did you get anyone at apple to look at your logs and acknowledge there is a problem?
    Would be happy for a suggestion on how to proceed. Already been the apple store genius and tech on phone route.

Maybe you are looking for