Apr 6, 2010 1:48 PM
How to optimize text editing performance in Flash Builder 4?
-
Like (0)
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) 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
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
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
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?
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.
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
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.
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:
.
Vibs
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
North America
Europe, Middle East and Africa
Asia Pacific
Copyright © 2011 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).