9 Replies Latest reply on Aug 12, 2011 6:44 AM by Ged_mc

    How to optimize text editing performance in Flash Builder 4?

    cubelogic

      I am running Flash Builder 4.0.0 (build 272416) on a Macbook Pro 2.4 Ghz with 4Gb RAM. I am experiencing extremely poor performance while simply editing moderately complex MXML files.

       

      By poor performance I mean noticeable lag between keystrokes. Type one char, wait 2 or 3 seconds on a 700 lines MXML with about 20 buttons, 2 AdvancedDataGrids, 1 text area. Fairly complex, but that's what I need.

       

      Opening said MXML file takes around 12 seconds.

       

      Saving said MXML results in around 8 seconds: no automatic building, nothing else being done.

       

      On trivial MXMLs there's still a noticeable lag while typing, around 0.5 seconds per char.

       

      At this point Flash Builder 4 is unusable for me: editing .as files is still decent, but for MXMLs is almost impossible to work with, as you can see from the numbers above.

       

      Is there *anything* I can do to improve text editing performance? I've disabled all sort of niceties (automatic completion, indentation and so on) in the prefs, sadly to no avail. This is a major inconvenience for us.

        • 1. Re: How to optimize text editing performance in Flash Builder 4?
          Jason San Jose Adobe Employee

          1) Are you using plug-in or standalone? If standalone, the default memory settings should be ok. If plug-in and in an external Eclipse distribution (i.e. not the bundled Eclipse), you'll want to change your memory settings. See this blog post http://blogs.adobe.com/jasonsj/2010/02/improving_compiler_performance.html. You can monitor memory usages simply within Eclipse under Preferences > General > Show heap status.

          2) Try turning off mark occurrences (the highlighter button in the toolbar)

           

          I tried to reproduce this in a similarly sized Flash Catalyst MXML file and didn't see any issues. Opening a file shouldn't take 12 seconds unless for the initial hit for loading the project the first time.

           

          I'd be curious to see if a clean workspace would fix your issue. That might indicate a cache problem.

           

          Jason San Jose

          Software Engineer, Flash Builder

          1 person found this helpful
          • 2. Re: How to optimize text editing performance in Flash Builder 4?
            cubelogic Level 1

            Hi Jason, thanks for replying.

            I am using the standalone.

             

            I disabled "mark occurrences", it is very mildly better. I still see a multi-seconds lag while typing 4 or 5 characters one after the other.

             

            I upped my Java memory settings for -Xmx from 512 to 1024:

             

            -Xms256m

            -Xmx1024m

            -XX:MaxPermSize=256m

            -XX:PermSize=64m

             

            I don't think this is related though.
            When you say "clean workspace" / cache problem, do you mean simply doing Project -> Clean...  ?
            Or is there something more in-depth you are suggesting?
            I can live with 10 seconds opening time. But it's the typing lag that makes FB4 unusable. I can't have a spinning wheel every 5 characters.
            Thanks again.
            • 3. Re: How to optimize text editing performance in Flash Builder 4?
              Jason San Jose Adobe Employee

              Oops. Sorry, I should have clarified how to get a clean workspace.

               

              1) Go to File > Switch Workspace > Other... and choose an new, empty folder.

              2) Import your existing project by going to File > Import, General > Existing projects, and find the location of your project in the old workspace. The default location on mac is /Users/you/Documents/Adobe Flash Builder 4/your_project

               

              Jason San Jose

              Software Engineer, Flash Builder

              • 4. Re: How to optimize text editing performance in Flash Builder 4?
                cubelogic Level 1

                No effect. I followed exactly your steps. Possibly a little worse, probably because of the autocompletion options I had disabled and in the clean-slate workspace were reenabled.

                 

                I did not copy over the resources from the old location. I assume it's not important where the source files are located.

                 

                Where is the cache you were talking about actually stored on the disk?

                • 5. Re: How to optimize text editing performance in Flash Builder 4?
                  cubelogic Level 1

                  OK, found it. This post indirectly inspired me the solution.

                   

                  The culprit was that under my project settings -> Flex Build Path -> Source Path   I had 2 additional *library* source paths.These were actually redundant since I could specify them inside Library Path -> [lib] -->Source Attachment. So I did.

                   

                  As soon as I removed them from Source Path into Source Attachment, text editing became snappy again. Yay!

                   

                  It still looks like a severe bug to me, and I have no idea why that would cause such slowdowns, but at least I have a workaround.

                   

                  Thanks.

                  • 6. Re: How to optimize text editing performance in Flash Builder 4?
                    Jason San Jose Adobe Employee

                    Say what? If I read that right...

                     

                    1) Under Build Path > Library Path, you have foo.swc

                    2) Under Build Path > Source Path, you had a path to the source of foo.swc

                     

                    And your solution was to remove the source path and add the source attachment? The definitions from the source would clobber the definitions read from the SWC. That could perhaps lead to some issues, but what I'm not sure.

                     

                    If the SWC you're using is open source, I'd like to file the bug and get it reproduced here. Perhaps there's some characteristic of that project that presents some issues.

                     

                    I'm glad you were able to figure that out on your own. I wouldn't have guessed that one.

                     

                    Jason San Jose

                    Software Engineer, Flash Builder

                    • 7. Re: How to optimize text editing performance in Flash Builder 4?
                      cubelogic Level 1

                      You understood correctly:

                      - I removed all Build Path > Source Paths

                      - I moved those paths over to Library Paths > Source attachment

                       

                      I took inspiration by how the Flex SDK is added to the project. Flex and flex related frameworks (e.g. datavisualization lib)  also specify a Source Attachment under Lib Path. If I remove the source attachment I am not able to drill down into Flex code when I want to by Command-clicking on a class name (or hitting F3).

                       

                      All my SWC are open source. BTW some of the source paths I was using were the path to the Flex code and to datavisualtization lib, which I think are the biggest library I am linking against. So maybe to recreate, just add those 2 libraries and make sure to add the source path AND source attachment.

                       

                      I am using RSLs for every library if that matters.

                       

                      I don't understand why specifying a Source Attachment would cause any issues...  the swc is in sync with the source specified in its source attachment.

                      • 8. Re: How to optimize text editing performance in Flash Builder 4?
                        vibsgupta Level 1

                        Here is one method that I have found successful.

                         

                        Actually super slowing of my Flash Builder 4.0.1 doesn't happen always. Its more like twice or thrice in a week at most but when it happens it happens consistently.

                         

                        One SURE Shot way to get your text editor working back is to follow the follow steps:

                         

                        1. Make sure that you have disable 'Mark Occurences' button.
                        2. After disabling that button 'Right Click' on your project and Export it was a Single Archive File as shown in the pic below
                        3. http://i28.tinypic.com/rhsnsp.jpg.
                        4. Delete your Project (from the hardrive as well)
                        5. Import it again by going into 'import'
                        6. Hopefully editor should work fine now.

                         

                         

                        Vibs

                        • 9. Re: How to optimize text editing performance in Flash Builder 4?
                          Ged_mc Level 1

                          My Flash Builder 4.5 became super-slow, constantly rebuilding workspace.

                          The issue stopped after I removed the project folder from Jungle-Disk synch folder ( a cloud online back up program )

                          Hope this helps