Speed issue when getting bounds of single monitor in multi-screen display

I've written the following code which should get the bounds of the first monitor in a n-view (multi-screen) set up so I can size JFrame objects relative to the dimensions of this first monitor. However, this bit of code seems to slow done my constructor by a significant amount of time (ie my program now takes 5 seconds to load as opposed to loading almost instaneously). Is there anything I can do to get this information more quickly? And why does this code take so long to execute?
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs =  ge.getScreenDevices();
GraphicsDevice gd = gs[0];
GraphicsConfiguration[] gc = gd.getConfigurations();
Rectangle virtualBounds = new Rectangle(gc[0].getBounds());      Thanks in advance,
-jake

I was curious (having never delt with this stuff before about your problem so I put your code into a simple frame and ran it. Sure enough it took on average 2.7s to determine the bounds information and less than a tenth of a secondto setup the GUI. So I added code to print out the timmings of each call in your code and found that almost all of it was in "gd.getConfigurations()". This method says it returns all of the GraphicsConfiguration objects for the device. That could be a lot of objects (on my system it returns 8).
When I switched to calling getDefaultConfiguration I get the same answer and it comes back in 0 milliseconds making the GUI setup the slowest part:-)
I am not sure if getDefaultConfiguration is what you want. It is unclear to me that the first element in the configurations array represents the current mode of the device and it is unclear if the detault is the current mode either. I guess you can experiment and see if the default is the configuration you want or not.
good luck,
IL
I attached my code so you can see what I did:/*
* Created on Jul 12, 2003
* Created by Leslie Software (<a href="mailto:[email protected]">[email protected]</a>)
* Copyright 2003 Leslie Software
package forum.multiplemonitors;
import javax.swing.*;
import java.awt.*;
* @author ileslie Leslie Software (<a href="mailto:[email protected]">[email protected]</a>)
public class MultipleMonitorsFrame extends JFrame {
     public static void main(String[] args) {
          MultipleMonitorsFrame frame = new MultipleMonitorsFrame ();
          frame.setVisible (true);
     public MultipleMonitorsFrame ()  {
          super ("Monitor Query Timing");
          setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
          long timeBeforeMonitorQuery = System.currentTimeMillis ();
          //  Get the information on the first monitor
          GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
          GraphicsDevice[] gs =  ge.getScreenDevices();
//          System.out.println ("After getScreenDevices\t " + System.currentTimeMillis ());
          GraphicsDevice gd = gs[0];
          //  Origonally retrieving all configurations and looking at the first
//          GraphicsConfiguration[] gc = gd.getConfigurations();
//          System.out.println ("After getConfigurations\t " + System.currentTimeMillis ());
//          Rectangle virtualBounds = new Rectangle(gc[0].getBounds());
          //  Now just asking for the default          
          GraphicsConfiguration defaultgc = gd.getDefaultConfiguration();
          Rectangle virtualBounds = new Rectangle (defaultgc.getBounds());
          long timeAfterMonitorQuery = System.currentTimeMillis ();
          long monitorQueryTime = timeAfterMonitorQuery - timeBeforeMonitorQuery;
          long timeBeforeGUISetup = System.currentTimeMillis ();
          //  Setup the GUI
          //  Report on timing (including dummy string for gui setup
          JLabel monitorTimeLabel = new JLabel ("Finding out about the monitor took " + monitorQueryTime + " milliseconds");
          JLabel guiSetupTimeLabel = new JLabel ("X");
          //  Report on monitor dimentions          
          JPanel monitorInfoPanel = new JPanel ();
          JLabel monitorInfoTitle = new JLabel ("First monitor size is:");
          JTextField monitorWidth = new JTextField ("" + virtualBounds.width);
          monitorWidth.setEditable(false);
          JLabel monitorInfoBy = new JLabel ("by");
          JTextField monitorHeight = new JTextField ("" + virtualBounds.height);
          monitorHeight.setEditable(false);
          monitorInfoPanel.add (monitorInfoTitle);
          monitorInfoPanel.add (monitorInfoTitle);
          monitorInfoPanel.add (monitorWidth);
          monitorInfoPanel.add (monitorInfoBy);
          monitorInfoPanel.add (monitorHeight);
          getContentPane ().add (monitorTimeLabel, BorderLayout.NORTH);
          getContentPane ().add (monitorInfoPanel, BorderLayout.CENTER);
          getContentPane ().add (guiSetupTimeLabel, BorderLayout.SOUTH);
          pack ();
          long timeAfterGUISetup = System.currentTimeMillis ();
          long guiSetupTime = timeAfterGUISetup - timeBeforeGUISetup;
          //  This is technicly wrong since we should not be accessing a realized GUI component
          //  outside of the event thread but it works and this is just a test app     
          guiSetupTimeLabel.setText ("Setting up the GUI took about " + guiSetupTime + " milliseconds");
}

Similar Messages

  • Iteration Speed issue when Indexing 3D array wried to a while-loop

    Brief Description of my Program:
    I am working on the real-time signal generation by using LabView and DAQmx (PCI-6110 card). My vi reads the big data file (typically 8MB txt file containing about 400,000 samples (complex double precision). Then, the signal is pre-processed and I end up with a huge 3D array to feed while-loop (typically 3D array dimension is N x 7 x M where N & M >> 7). Inside the loop, that 3D array is indexed and processed before the results are written to the DAQmx outputs. I have a speed issue when indexing the large 3D array (i.e, 3D array having a large sub-array size). My while-loop could not run fast enough to top-up the DAQmx AO buffer (at the output rate of 96kHz). It could run faster only if I use smaller 3D array (i.e, smaller-sized sub-arrays). I do not quite understand why the size of 3D sub-array affects the rate of looping although I am indexing same sub-array size at each iteration. I really appreciate your comments, advices and helps.
    I include my 3D array format as a picture below.
    Question on LabView:
    How does indexing an 3D array which wires to the while-loop affect the speed of the loop iteration? I found that large dimension of sub-arrays in the 3D array slows down the iteration speed by comparing to indexing the same size of sub-array from smaller-sized sub-arrays of the 3D array to perform signal processing inside the while-loop. Why? Is there any other way of designing LabView Program to improve speed of iteration?
    attachment:

    Thank you all for your prompt replies and your interests. I am sorry about my attachment. But, I have now attached a jpg format image file as you suggested.
    I had read the few papers on large data handling such as "LabVIEW Performance and Memory Management". Thus, I had already tried to avoid making unnecessary copies of data and growing arrays in my while-loop. I am not an expert on LabView, so I am not sure if the issues I have are just LabView fundamental limitations or there are any other ways to improve the iteration speed without reducing the input file size and DAQ output rate.
    As you request, I also attach my top-level vi showing essential sections such as while-loop and its indexing. The attached file is as an image jpg format because the actual vi including Sub-VIs are as big as 3MB in total. I hope my attachment would be useful for anyone who would like to reply my question. If anyone would like to see my whole vi & llb files, I would be interesting to send it to you by an e-mail privately and thus please provide your e-mail address.
    The dimension of my 3D array is N x 7 x M (Page x Row x Column), where N represents number of pages in 3D array, and M represents the size of 1D array.  The file I am currently using forms 3D array of N = 28, & M = 10,731.  Refering to the top-level vi picture I attached, my while-loop indexes each page per iteration and wrap-around.  The sub-VI called "channel" inside the while-loop will further index its input (2D array) into seven of 1D arrays for other signal processsing.  The output from that "channel" sub-VI is the superposition of those seven arrays.  I hope my explaination is clear. 
    Attachement: 3Darray.jpg and MyVi.jpg
    Kind Regards,
    Shein
    Attachments:
    3Darray.jpg ‏30 KB
    MyVI.jpg ‏87 KB

  • Internet speed issues when macbook pro joins Airport Network

    I have an apple tv, two iphones, a PC and a macbook sharing a Airport Extreme internet connection.
    The problem is that all devices are working on full internet speed until i connect my macbook pro late 2009.
    Normaly i have a download speed at 650kb/s but when the macbook connects to the Airport extreme the internet speed is jumping between 20kb/s and 200kb/s
    The unusual thing are the jumps and drops of the speed.
    When i shut down the Macbook all other devices are running on normal internet speed and the internet connection is not jumping anymore.
    What the **** is going on?

    SOLUTION FOUND to MacBook Pro poor Wi-Fi wireless signal.
    First, let's talk about the actual problem: too much signal noise. There is a hidden app in OSX called "Wi-Fi Diagnostics" This will tell you everything you need to know why your Wi-Fi is not working!
    http://support.apple.com/kb/HT5606
    HINT: It is included in 10.7, just look for it.
    The solution!
    Turn off your wi-fi and run your internet through your home's electrical wires. Power-line adapters are devices that turn a home's electrical wiring into network cables for a computer network.
    http://reviews.cnet.com/2733-3243_7-568-8.html
    I purchased TP-LINK TL-PA511 and for the first time I'm downloading with ALL my internet speed (30mb down / 5mb up) tested via www.speedtest.net. I'M SOOOOO HAPPY!!!!
    http://www.amazon.com/TP-LINK-TL-PA511-Powerline-Starter-Kit/dp/B0081FLFQE/ref=s r_1_1?ie=UTF8&qid=1385395374&sr=8-1&keywords=TP-LINK+TL-PA511

  • Does Itunes 8 fix playback speed issue when downloading

    Does the new Itunes 8 fix the slow playback speed issues whenever you are downloading music or a podcast within Itunes?

    For the record, the reported issue seems to have been solved.
    http://lists.apple.com/archives/cocoa-dev/2007/Oct/msg01012.html

  • Speed issue when using Airport Express

    Hello.
    I have had an ongoing battle recently with Internet download speeds.
    I connect my iMac to my Airport Express.
    iMac has Firewall ON.
    When I connect this way, I get slow connection / download speeds.
    The file I am using in this example is the MS Office 2003 SP3 update.
    I get around 200kbps.
    However....
    When I connect my iMac directly via Ethernet to my Cable Modem, I am getting 1.5mbps download.
    Can anyone shed any light on this and advise how I can correctly configure the Airport to get nearer this speed?
    Many thank in advance
    Glenn

    Have you repaired Permissions since the last update/upgrade?
    If not, either do that or get Applejack...
    http://www.versiontracker.com/dyn/moreinfo/macosx/19596
    After installing, reboot holding down CMD+s, then when the prompt shows, type in...
    applejack AUTO
    Then let it do all 5 of it's things.
    At least it'll eliminate some questions if it doesn't fix it.
    The 5 things it does are...
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start
    While watching Activity Monitor>Networks, are there dips in the download speed, or just flat slow input?
    How many bars do you get?
    What speed does it say it's connecting at in Network Utility?

  • Slow speed issue not getting what i was promised

    Hi
    After having no luck no the phone and feeling like i was fobbed off i was wondering if anyone can help here.
    I had BT infinity 2 installed 2 weeks ago and have never received over 40MEG when i was promised between 59.9 and 79.9.
    I rung up on Saturday and i was told a engineer would look at the line and call me back. After recieving no call back i rung today and was told that 40 was the expected speed of the line.... even tho when i purchased BT infinity 2 i was told and have in writing on my receipt that i would get speeds of 59-79.
    I now look on the BT site and notice that if i put in my postcode on the website it now says i should get between 35-45.
    When the engineers installed it they did seem like they where here for a while and maybe relalised they couldn't give the speeds that they originally promised me.
    Im really not happy as i was still promised the higher speeds of 59-79, its more the upload that i wanted as i was promised 19-20 and am getting 7 currently.I have been told to ring back in 48 hours again if speed doesn't increase which i know it wont as it hasn't in the past 2 weeks.
    Feeling a bit like i shouldn't have joined BT as i am not getting what i am paying for. Can any of the mods help with this issue?

    HI
    Thanks for thr reply. Find attached:
    Featured ProductsDownstream Line Rate(Mbps)Upstream Line Rate(Mbps)Downstream Range(Mbps)Availability Date  High Low High Low    
    FTTC Range A (Clean)
    50.7
    35.2
    12.4
    7.8
    Available
    FTTC Range B (Impacted)
    43.6
    23.9
    12.4
    6.1
    Available
    WBC ADSL 2+
    Up to 8
    6.5 to 14
    Available
    WBC ADSL 2+ Annex M
    Up to 8
    Up to 1
    6.5 to 14
    Available
    ADSL Max
    Up to 6
    5 to 8
    Available
    WBC Fixed Rate
    2
    Available
    Fixed Rate
    2
    Available
    Other Offerings
    Fibre Multicast
    Available
    I currently get a test error when i try the further diagnostics on the second link, ill try again shortly and post back results.

  • Permissions issues when getting started

    Hi, I'm trying to create a test "Hello World" app on our IIS server.  When the user clicks a button a pop up should say "Hello World!", which is a string returned by a WCF web service on the same server.  I have no problem getting the service to work on an aspx page.  But in Flex debugger I get the error:
    [SWF] /TestProject2/TestProject2.swf - 1,110,380 bytes after decompression
    Warning: Domain our-server.local.ourserver.com does not specify a meta-policy.  Applying default meta-policy 'master-only'.  This configuration is deprecated.  See http://www.adobe.com/go/strict_policy_files to fix this problem.
    Error: Request for resource at http://ftp-server.local.mycompany.com/Service_Upload.svc/basic by requestor from http://upload.mycompany.com/TestProject2/TestProject2.swf is denied due to lack of policy file permissions.
    *** Security Sandbox Violation ***
    Connection to http://our-server.local.mycompany.com/Service_Upload.svc/basic halted - not permitted from http://upload.mycompany.com/TestProject2/TestProject2.swf
    I've created a crossdomain.xml file and tried various settings to try to open up access, including adding *.mycompany.com *.local.mycompany.com, etc., and at the moment I'm using this.
    <?xml version="1.0"?>
    <!-- http://upload.mycompany.com/crossdomain.xml -->
    <cross-domain-policy>
        <allow-access-from domain='*' to-ports='*' />
    </cross-domain-policy>
    No matter what I do I get the permissions error when my Flex app calls the following function:
    <![CDATA[
    import com.mycompany.HelloResultEvent;
        import com. mycompany.Service_Upload;
        import mx.controls.Alert;
        public function sayHello():void {
            var service:Service_Upload = new Service_Upload();
            service.addhelloEventListener(
                function (event:HelloResultEvent):void {
                    Alert.show(event.result);
            service.hello();
    ]]>
    I got a demo project to call an external service.  Why am I getting this permissions error on my own server, especially when the service and the swf are on the same server and the crossdomain.xml seems to clearly open up permissions?

    Hi Louellen
    After you go to 'eprintcenter.com' and click the sign in button there will be another window with a sign up button, after you sign up it will ask for the printer code.  After that you will be asked if you want to customize your printers email address.
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • Speed Issue (when AS is used in a Cocoa app)

    Folks;
    First I have posted this on the Cocoa list!
    I am also posting this here because I believe the underlying issue is somewhere between Cocoa and AppleScript and I am not certain where I will find useful advice...
    I have a Cocoa app that has some iPhoto integration.
    Since there is no Cocoa API for iPhoto, like there is for AddressBook, the only way I know to do this is through AppleScript.
    Any other ideas here would be appreciated....
    BTW: This is OS 10.4.10; Xcode 2.4.1; iPhoto 6.0.6; 2 GHz C2D
    The Cocoa app has a compiled AppleScript which I call into for the various handlers with the parameters I need.
    This is working well in every other case.
    For the record it looks like this:
    thisResult = [[[NSApp delegate] asEngine] executeAppleEvent:[ASCode callSub:@"getiPhotoImage" params:
    [NSAppleEventDescriptor descriptorWithString:path],
    nil] error:&errorDict];
    However I have a case where it is taking 25 seconds to execute a single AppleScript statement!
    This same statement has sub-second response when executed in the Script editor.
    If I simulate the Cocoa calls with various handlers in the Script Editor everything is fine - performance is fine!
    I have logging statements embedded in both Cocoa and AppleScript which have allowed me to hone in on the offending statement.
    The result is perfectly repeatable. Every time it takes 25 SECONDS to execute the following:
    [Cut and Paste this into a Script Editor - should work fine...(just change the myPath variable to make it work or fail]
    [You can also save it as a run-only application to see the performance is that incarnation...]
    set myPath to "/Users/SOMEUSERNAME/Pictures/iPhoto Library/Originals/2007/Roll 1/SOMEPICTURENAME.jpg"
    tell application "iPhoto"
    try
    set thisPhoto to first photo whose image path is myPath -- << THIS IS THE CULPRIT
    if thisPhoto exists then
    display dialog "'" & name of thisPhoto & "' was found"
    else
    display dialog "This branch will never occur"
    end if
    on error e number n
    if n = -2753 then
    display dialog "Requested photo was NOT found"
    else
    display dialog "Error: " & n & " - " & e
    end if
    end try
    end tell
    Could anyone shed any light on what is going on here?
    Is there a hidden AppleScript feature like iTunes' 'fixed indexing' which might improve response times?
    Why does it work in Script Editor or as a AS run-only application but then yield such miserable performance under Cocoa?
    Thanks for any and all thoughts!
    Steve

    For the record, the reported issue seems to have been solved.
    http://lists.apple.com/archives/cocoa-dev/2007/Oct/msg01012.html

  • PL/SQL speed issues when using a variable

    I have a very strange issue that is causing problems.
    I am running Golden connecting to a 11g database.
    I created a procedure to insert records into a table based on a query. The source query includes variables that I have populated prior to the insert statement. The problem is that if I use the variable for one very specific where statement, the statement goes from running in less than 1 second, to running in 15 minutes. It gets even more strange though. Not only does a 2nd variable not cause any problems, the exact same variable in the same statement works fine.
    This procedure takes 15 minutes to run.
    declare
        v_start_period date;
        v_end_period date;
    begin
        select add_months(trunc(sysdate,'mm'), -1), trunc(sysdate,'mm')
        into v_start_period, v_end_period
        from dual;
        insert into RESULTS_TABLE
                (first_audit_date, last_audit_date,
                data_column1, data_column2, data_column3)
            select
                a.first_audit_date, a.last_audit_date,
                b.data_column1, b.data_column2, b.data_column3
            from
                SOURCE_TABLE_1 b,
                (select marker_id, min(action_time) as first_audit_date, max(action_time) as last_audit_date
                    from SOURCE_TABLE_2
                    where action_time >= v_start_period and action_time < v_end_period
                    group by marker_id) a
            where b.marker_id = a.marker_id
                and exists (select 1 from SOURCE_TABLE_2
                    where marker_id = b.marker_id
                    and action_time >= v_start_period and action_time < v_end_period
                    and action_type = 'XYZ');
        commit;
    end;This procedure runs in less than 1 second, yet returns the exact same results.
    declare
        v_start_period date;
        v_end_period date;
    begin
        select add_months(trunc(sysdate,'mm'), -1), trunc(sysdate,'mm')
        into v_start_period, v_end_period
        from dual;
        insert into RESULTS_TABLE
                (first_audit_date, last_audit_date,
                data_column1, data_column2, data_column3)
            select
                a.first_audit_date, a.last_audit_date,
                b.data_column1, b.data_column2, b.data_column3
            from
                SOURCE_TABLE_1 b,
                (select marker_id, min(action_time) as first_audit_date, max(action_time) as last_audit_date
                    from SOURCE_TABLE_2
                    where action_time >= v_start_period and action_time < trunc(sysdate,'mm')
                    group by marker_id) a
            where b.marker_id = a.marker_id
                and exists (select 1 from SOURCE_TABLE_2
                    where marker_id = b.marker_id
                    and action_time >= v_start_period and action_time < v_end_period
                    and action_type = 'XYZ');
        commit;
    end;The only difference between the two is where I replace the first v_end_period variable with trunc(sysdate,'mm').
    I've been googling for possible solutions and keep running into something called "parameter sniffing". It appears to be a SQL Server issue though, as I cannot find solutions for Oracle. I tried nesting the insert statement inside it's own procedure with new variables populated by the old variables, but nothing changed.
    Edited by: user_7000017 on Jan 8, 2013 9:45 AM
    Edited by: user_7000017 on Jan 8, 2013 9:52 AM Put the code in code tags.

    You are not describing procedures. You are listing anonymous PL/SQL blocks.
    As for the code - this approach to assigning PL/SQL variables are highly questionable. As the functions are native PL/SQL functions too, there is no need to parse and execute a SQL cursor, do context switching, in order to assign values to PL/SQL variables.
    This is wrong:
    select
        add_months(trunc(sysdate,'mm'), -1), trunc(sysdate,'mm')
        into v_start_period, v_end_period
    from dual;This is correct:
    v_start_period := add_months(trunc(sysdate,'mm'), -1);
    v_end_period := trunc(sysdate,'mm');Just as you would not use +"select 1 into plVariable from dual;+", instead of a standard variable assignment statement like +"plVariable := 1;"+.
    As for the performance/execution difference. Does not make sense. I suggest simplifying the code in order to isolate the problem. For example, take that in-line SQL (aliased as a in the main SQL) and create a testcase where it uses the function, versus a PL/SQL bind variable with the same data type and value as that returned by the function. Examine and compare the execution plans.
    Increase complexity (if no error) and repeat. Until the error is isolated.
    The 1st step in any troubleshooting, is IDENTIFYING the problem. Without knowing what the problem is, how can one fix it?

  • Speed issue when drawing field of Rectangles

    I'm working on a fullscreen java app that consists of a 320x320 field of randomly-colored dots, a variable percentage of which should eventually move in concert at up to 100 fps. Right now I'm simply working on drawing a varying field of dots on the screen at that speed. I'm using multiple buffers with the help of the MultiBufferTest example from Sun's Full Screen Exclusive Mode API tutorial. The demo runs great, pages flipping at what appears to be the speed at which I need my graphics to appear on the screen, but the demo draws only one Rectangle.
    The problem I'm having seems to be the speed at which my 102400 Rectangles are being drawn on one of the back buffers before being flipped onto the screen. Right now I'm working with 3 buffers, but it doesn't seem to matter how many I use; the speed at which the field appears to plateau at around 1 fps. Some thoughts:
    * My random color generation code is outside of the rendering loop.
    * I've casted the Graphics object into a Graphics2D object g2, but that hasn't helped.
    * The Rectangles are drawn inside nested for loops by row (r) and column (c) using g2.fillRect(c * mSide, r * mSide, mSide, mSide); where mSide is the side length of each Rectangle.
    * Is it possible to draw all the frames into a Vector of buffers before the 'animation' begins? Presumably it would still take around 1 second to generate each frame that will appear, so that probably wouldn't work too well.
    * I have the O'Reilly book Java 2D Graphics, but it doesn't help much in this situation.
    I'm a novice at Java and a novice at graphics programming to boot, so is there anyone out there that can give me some advice on how to speed up the graphics generation?

    I'm working on a fullscreen java app that consists of a 320x320 field of randomly-colored dots, a variable percentage of which should eventually move in concert at up to 100 fps. Right now I'm simply working on drawing a varying field of dots on the screen at that speed. I'm using multiple buffers with the help of the MultiBufferTest example from Sun's Full Screen Exclusive Mode API tutorial. The demo runs great, pages flipping at what appears to be the speed at which I need my graphics to appear on the screen, but the demo draws only one Rectangle.
    The problem I'm having seems to be the speed at which my 102400 Rectangles are being drawn on one of the back buffers before being flipped onto the screen. Right now I'm working with 3 buffers, but it doesn't seem to matter how many I use; the speed at which the field appears to plateau at around 1 fps. Some thoughts:
    * My random color generation code is outside of the rendering loop.
    * I've casted the Graphics object into a Graphics2D object g2, but that hasn't helped.
    * The Rectangles are drawn inside nested for loops by row (r) and column (c) using g2.fillRect(c * mSide, r * mSide, mSide, mSide); where mSide is the side length of each Rectangle.
    * Is it possible to draw all the frames into a Vector of buffers before the 'animation' begins? Presumably it would still take around 1 second to generate each frame that will appear, so that probably wouldn't work too well.
    * I have the O'Reilly book Java 2D Graphics, but it doesn't help much in this situation.
    I'm a novice at Java and a novice at graphics programming to boot, so is there anyone out there that can give me some advice on how to speed up the graphics generation?

  • Speed Issues

    Greetings and Salutations,
    I'm having speed issues with my Adobe AIR application. From what I've read on the web, AIR is supposed to be fast at drawing graphics. I am writing an application which has multiple screens. On one of the screens I have a tab (SuperNavigator) which has a canvas on it. That canvas has a series of other canvases (built with a repeater) that have graphics in them. I am having speed issues when I have more than 50 of these children canvases. I've tried running it without the graphics (code below is without the graphics) to see how it performs. When I have 954 of these canvases being drawn it takes about 2.5 minutes to draw. This is unacceptable and I'm wondering if this is something I've induced or if AIR was never meant to handle such a large amount of canvases (actually this isn't a large amount, in a real world environment there could be a lot more). I've included relevant clips from the code. There are a couple empty boxes that in the real application will hold graphics.
    The class withing the Tab Navigator is a canvas.
    In the action Script (the setter line takes 2.5 minutes to get past) (it's binding to the repeater that seems to be my problem).
    [Bindable]  private
    private  var _assetList:Array;
    [Bindable]  
    public function get timelineAssetList():Array{ 
         return this._assetList;
    public function set timelineAssetList(ac:Array):void{ 
         this._assetList = ac;
    The MXML code that is being bound to:
     <mx:Canvas id="labelCanvas" left="0" right="0" top="0" height="65" verticalScrollPolicy="off" scroll="scrolling(event)">
          <mx:HBox horizontalGap="1" left="10" right="10" top="10">  
              <mx:Spacer width="2"/>  
                <mx:Canvas width="{getHeaderWidth()}" height="40" borderStyle="solid" borderColor="{StaticVariables.borderColor.getColorUint()}" horizontalCenter="0">
                <PastDataView:ColorBarScale id="scale" bottom="10"/>   
         </mx:Canvas>  
              <mx:Canvas width="20" height="40">  
                   <mx:Spacer width="20" />  
              </mx:Canvas>  
         </mx:HBox>  
    </mx:Canvas>
    <mx:Canvas id="assetCanvas" left="0" right="0" bottom="0" top="65" scroll="scrolling(event)">
         <mx:VBox y="10" right="16" left="10" verticalGap="0">  
              <mx:Repeater id="assetRepeater" dataProvider="{timelineAssetList}">  
                   <mx:HRule width="100%"/>
                   <PastDataView:ColorBarBar  id="barArray" width="100%" height="170" asset="{assetRepeater.currentItem}"/>  
              </mx:Repeater>
         </mx:VBox>  
    </mx:Canvas>
    The ColorBarBar consists of:
    <?xml version="1.0" encoding="utf-8"?><mx:Canvas  xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300" xmlns:PastDataView="org.XXXXXX.CenterScreen.PastDataView.*" horizontalScrollPolicy="off" click="clicked()">
         [Bindable] 
         public static var _colorBarHeight:int = StaticVariables.colorBarHeight;
         [Bindable] 
         private var _asset:Object;
         [Bindable] 
         public function set asset(a:Object):void{ 
              this._asset = a;          getBackgroundColor();
         public function get asset():Object{ 
              return _asset;     }    
          private function getBackgroundColor():void { 
              var color:String = asset.color; 
              if (color == null) color = "Black"; 
              if( color.toLowerCase() == "blue" ) {
                   lblAssetTag.setStyle("color", 0x1674cc);               lblAsset.setStyle(
    "color", 0x1674cc);          }
    else if( color.toLowerCase() == "red" ) {
                   lblAssetTag.setStyle("color", 0xe35353);               lblAsset.setStyle(
    "color", 0xe35353);          }
    else if(color.toLowerCase() == "grey" || color.toLowerCase() == "gray") {               lblAssetTag.setStyle(
    "color", 0xe55555);               lblAsset.setStyle(
    "color", 0xe55555);          }
    else { // give it a default color                lblAssetTag.setStyle(
    "color", 0x000000);               lblAsset.setStyle(
    "color", 0x000000);          }
          private function calculateActivityRepeaterHeight():int{ 
              return this.height-50-_colorBarHeight;     }
          public function clicked():void{
              dispatchEvent(new SelectAssetEvent(this._asset, false, false, true));     }
         ]]>     </mx:Script>
           <mx:VBox left="0" top="0" right="0">
               <mx:Spacer height="1"/>
               <mx:HBox>
                    <mx:Spacer width="2"/>               <mx:Label id="lblAssetTag" text="{asset.type}: " fontWeight="bold" fontSize="12" doubleClickEnabled="true" doubleClick="titleClicked()"/>  id="lblAssetTag" text="{asset.type}: " fontWeight="bold" fontSize="12" doubleClickEnabled="true" doubleClick="titleClicked()"/> id="lblAssetTag" text="{asset.type}: " fontWeight="bold" fontSize="12" doubleClickEnabled="true" doubleClick="titleClicked()"/> 
                   <mx:Label id="lblAsset" text="{asset.name}" fontSize="12" doubleClickEnabled="true" doubleClick="titleClicked()"/>
                    <mx:Label id="lblAssetId" text="{'(' + asset.id + ')'}" fontSize="12" visible="{mx.core.Application.application.debugMode}"/>
               </mx:HBox>
              <mx:HBox horizontalGap="1">
                    <mx:Spacer width="2"/>
                    <mx:Spacer width="10" />
                    <mx:VBox  width="100%">                    <mx:VBox>
                        </mx:VBox>   
                        <mx:VBox  id="displays" verticalScrollPolicy="auto" height="{calculateActivityRepeaterHeight()}" horizontalScrollPolicy="off">
                        </mx:VBox>   
                   </mx:VBox>   
              </mx:HBox>
              <mx:Spacer height="2"/>
          </mx:VBox></mx:Canvas>
    I would appreciate any thoughts or feedback you could provide.
    ~martin

    The Canvas is a very heavy object that has lots of overhead.  Even worse is the VBox object that is in there multiple times. 
    What exactally are you trying to accomplish?  Just looking over the code, it seems that the same could be done directly with the Graphics API, at a much faster rate.
    For each of the VBoxes and Canvases you have, the entire size of each child and parent need to be re-evalulated each time you add or change something.  This is a HUGE overhead, and probably why the app is running so slow.  You may need to convert this app to use simpler objects (UIComponent or something lower-level like that) to get any speed.
    Are you using Flex Bulder?  Take a look at the app while the Profiler is running to see what I'm talking about.

  • Sometimes when I quit Firefox, it makes my Mac screen turn solid blue. The computer does not crash, but I can't see anything. Help please!

    Sometimes when I quit Firefox, it makes my Mac screen display solid blue color. The computer does not crash, but I can't see anything. Opening programs, nor hitting any shortkey makes the display work again, so I have to shut down.
    I am using Macbook pro, OS 10.6.8, 4 GB memory, 2 ghz intel processors i7. This has happened about 6 times in the last 3 months. Seems to be getting more frequent. Sometimes happens after using Netflix streaming video, sometimes after browsing sites that don't play video. I frequently use Pandora, but have Firefox set to dump cache, memory, etc. after each use.

    Have you tried a safe start by holding the shift key when you boot? If that works, and it can take a while to complete, see if a regular boot now works. If it does, you need to free up space on your hard drive.
    If a safe boot doesn't work, you need to either boot from an OS X DVD or go into target disk mode to connect via firewire cable to another mac to free up space on your hard drive. You need 5GB min, with 10% to 15%, or more, better, for systems usage.  If you have a backup, move some data files to it, erase them and empty the trash.

  • When I turn on my macbook pro, the white screen displays a file with a question mark in the middle. What does this mean?

    Suddenly, my macbook pro has experienced problems. When I turn on my computer, the white screen displays a flashing file folder icon with a quesrion mark in the middle. Has my hard drive burnt out? Thank you in advance for any helpful suggestions..

    It means your computer is search for a start up volume.  You need to reboot into recovery mode and attempt to repair your disk.  To do this restart the computer and hold the keys:
    <command> + r
    Then open Disk utility.
    http://support.apple.com/kb/ts1417

  • I have been having a issue with getting the colors on my monitor to match the colors fro my print lab. I now have the monitor calibrated to match the prints but when I open elements it doesn't use the same colors. If i have it use the calibrated profile b

    I have been having a issue with getting the colors on my monitor to match the colors fro my print lab. I now have the monitor calibrated to match the prints but when I open elements it doesn't use the same colors. If i have it use the calibrated profile by changing the color management settings, the color picker no longer shows true white or black. How do I get elements 12 to honor the new calibrated settings?

    Ok so I've done what you said and this is what it's come back ....
    I don't know that these are the errors , but they're the things which don't look right ...
    Throughout the shut down there is a recurring line ;
    It says ;
    Com.apple.launchd 1 0x100600e70.anonymous.unmount 301 PID still valid
    Then there are 2 more which I think are related ;
    Com.apple.securityd 29 PID job has I overstayed its welcome , forcing removal.
    Then the same with fseventd 48 and diskarbitrationd 13
    Oh and on Launchd1 : System : stray anonymous job at shut down : PID 301 PPID13 PGID 13 unmount...
    Then the last process says "about to call: reboot (RB_AUTOBOOT).
    Continuing...
    And stops ...
    Hope this means something to you ... Thanks again for your help so far :-)

  • I'm getting the below issue when I try to deploy a report with Dynamic parameters, when I deploy it with static parameters I'm not getting this issue.

    I’m getting the below issue when I try to deploy a crystal report with Dynamic parameters in BI Launch Pad, when I deploy the same report with static parameters I can deploy and run it. I have Restarted the BI server, still the issue exitno use. kindly help me on this issue.
    “This error occurred: Adding Crystal Report "CrystalReport1.rpt" failed. The server with kind rptappserver returned an error result. Failed to copy the report file to the report object. Refreshing the report object properties might have failed. Failed to read data from report file CrystalReport1. Reason: Failed to read parameter object”.

    BO does not run dynamic params through the report as would happen without BusinessObjects (BO) or Crystal Reports Server (CRS).  When you publish a report with dynamic parameters to BO/CRS, the prompt is published to the repository so that it can be accessed through the Business View Manager (which can be installed as part of the client tools).  In order for this to work a couple of things need to happen:
    1.  You need to be sure that you check the "Update Repository" box on the Save As screen the first time you publish the report.
    2.  Your BO/CRS user needs to have "view" access to the Crystal2013ReportApplicationServer in the Servers section in the CMC - in fact, the Everyone group should be given view access to the server in order for dynamic prompts to work correctly.
    3.  In the Business View Manager, the Administrator user needs to give your user, or, even better, a Crystal Developers group full control access to the "Dynamic Cascading Prompts" folder.
    Best practice for dynamic prompts in a BO/CRS environment is to actually create the prompts in the Business View Manager.  This will allow you to create a single data connection that can be reused and also create lists of values such that the same list or prompt can be reused by multiple reports.  If you just create the prompts in Crystal, you will end up with multiple data connections to the same database, the prompts will use the whole query for the reports to get the dynamic values instead of just a focused query to the lookup table that contains the values, and there ends up being lots of duplication and chaos.
    -Dell

Maybe you are looking for

  • Mac mini Server mid.2010 upgrade to Mavericks?

    Hi, my Mac mini Server (2.66GHz Intel Core Duo, 8Gb RAM) running OS X 10.8.5 does not propose me to upgrade to Mavericks through "Software Update". Does it mean it's not safe to upgrade? Why do I read that a Mac Mini more recent than 2009 can run Mav

  • There is no "organize bookmarks" in the bookmark menu?

    I am trying to import bookmarks from google chrome and followed your instructions on exporting bookmarks to a file in "My Documents". The file (google bookmarks) is there. When I try the second part of your instructions and click on bookmarks in Fire

  • [39008] Logical dimension table X has a source

    Hi I have a Fact table with some dimensions. If I add a detail table to that Fact table I get: [39008] Logical dimension table X has a source Y that does not join to any fact source. For each dimension that I had. Is this possible to model?. To have

  • BUFFER_POOL KEEP问题

    question from oracler: SYS@orcl>select * from v$version; BANNER Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production TNS for 64-bit Windows: Version 11.2.0.1.0

  • Backing Up:  Full iPhoto Fill/Folder or just Original & Modified files?

    If you're backing up to a server and you have unlimited storage space - would you: a.)  Copy your entire iPhoto Library file (which copies as an iPhoto Library Folder) with ALL of the Package Contents? - OR - b.)  Just copy over the Originals & Modif