The Grand Cloud

The Grand Cloud

Mar 11 / 8:47pm

Speeding up compilation of large Flex 3 applications

Joa Ebert posted a very interesting blog post about Compiling ActionScript in The Enterprise and I thought it would be interesting to explain what I did a while ago as part of the Anvil Flex Open Source Project to speed up compiling Flex 3 applications.   I should say we, because I had a lot of help from James Ward in building this.  Anvil Flex was desinged somewhat like a portal server and the application was then broken down into smaller sub-applications or "modules" (in the orginizational context and not the flex context).   Each module was designed so the it could be compiled and tested in a stand alone context.  There was also several common libraries that where shared with the entire application

About 6 months into this project compile times for the entire application where exceding 20 minutes and it was nearly impossible to do continuous integration.  One of the main problems with the flex compilers is each part of the compilation process (mxmlc, compc, opimizer, etc.) requires you to start a separate JVM, compile that small part of code and then shutdown the JVM.  Not only does starting and stoping the JVM take time, you also lose all the compilation information when you shut down. 

To solve this problem we build a custom Java compilation program called Taz that called directly into the Flex compiler classes, since the Flex compiler is written in Java.  It consited of the following steps:

1 - We designed a heirarchial build system in Ant that would allow you to build any part of the tree and it's descendets automatically.

2 - The common libraries and modules each had there own Ant build files that described their dependecies.

3 - On building the application we would first walk the tree and build a dependcy heirarchy in memory of what modules and libraries need to be built.

4 - Then as we compiled each library we would cache any pre-processing and loaded libraries that could be reused throughout the compilation process.

The result was compile times dropped from 20 plus minutes to around 4 minutes!    Then for continuous integration builds we set-up multiple builds that would first compile the individual modules and common libraries and then build the entire application.  This would prevent a single module from breaking the build of all the other modules.

A very interesting and logic next step would be to take this process and allow the compilation process on individual developers machines to use the latest libraries built remotely.  For example if a developer was working on module A that depended on module B they could specify to grab latest pre-built module B and any common libraries off a remote machine, like the last known good build from the continuous integration server.  You could also distribute the build across machines this way.

A final note,  a lot of people don't like Ant and say Maven is the build system of the future.  Acutally part of the reason I stop working on Anvil is the entire build process was in Ant and I also thought the trend was to using Maven for builds.  Then on my last project we used Maven extensively and I know believe that Ant actually might be better solution for compiling large and complicated Flex Applications.  One of the reasons I didn't like the Maven build system was a large part of our build process actually used Ant behind the scenes for everything that could not be easily done in Maven.  Yes, Flex Mojos and such can help compile a fairly standard Flex project, but when you project reaches a certain point of complexity that starts to fall apart.  Things such as bundling custom resource files, including special assets in the final build, linking common library files, etc.  it gets complicated really fast! 

I had previously said that the Anvil Flex project was dead, but the code lives on in sourceforge. If there is any interested this build process could be extracted out into a separate, stand alone project.

 

Filed under  //  actionscript   anvil   flex  

Comments (2)

Feb 18 / 10:20pm

Moving my blog to Posterous

I have been hosting my own blog for a number of years using WordPress.   It is fairly easy to host your own WordPress site if you now how to setup a MySQL database and Apache Web Server.  The problem is you have to worry about updates and backups.  I can never remeber how to update WordPress, how to back-up the MySQL database, etc. because I do it so infrequently. And most of all hosting my own blog is not really embracing cloud computing and SAAS.   So I decided to move to a hosted bloggin platform.

First I looked at a hosted WordPress blog, but custom domains are considered an advance feature you have to pay for (but it doesn't even say how much).  I am way to cheap to pay for a hosted blog.  And TypePad even charges for the basic blog features.

Then I looked into Tumblr.  I really liked Tumblr and it had a lot of great themes for your blog.  But it didn't have comments by default.  I soon discovered you have to sign-up for a separate Disqus.com account and enable Disqus on your Tumblr site.  That means comments do not feel integrated into Tumblr and posting a comment is confusing, with disqus.com branding on the comment seciont..  The user is asked to sign-up for disqus and it is especially anoying because if they don't after submitting the comment a pop-up comes up asking them to sign up.  I see commenting as essential for even a basic blogging platform so that was a major fail.

Lastly I tried Posterous.  The themes are fairly minimal and the features are not as robust Tumblr, but all I really wanted was to post my ideas on technology and get comments from my readers.  Commenting on posterous is dead simple and fully integrated, what a novel idea!  It also allowed me to import my old WordPress blog into posterous.  You do have to enable XML-RPC in WordPress which is in the writing settings of the admin panel.

So I am sticking with Posterous and so far really liking it!

Comments (1)

Feb 18 / 10:03pm

Fixed! - Adobe Air Auto-Update blank screen bug in Flex SDK 3.5a

The Flex SDK team finally decided to fix the problem with Adobe Air Auto-Update in Flex SDK version 3.5a.  Here are the notes from QA on the bug:

The Flex team has updated the 3.5 SDK with a small update that addresses this issue. The refreshed build, SDK 3.5a, has only a few files modified in order to fix this issue and this change does not affect the signing and caching of the SDK 3.5 RSLs originally released in December.

We encourage all developers using SDK 3.5 to upgrade their build to SDK 3.5a to continue their development. The SDK 3.5a build can be found in the “Latest Milestone Release Build” table here: http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3

Thank you for your patience as we worked to address this issue.

Comments (1)

Jan 6 / 2:59am

Adobe Air Auto-Update blank screen bug in Flex SDK 3.5

After spending a long time yesterday trying to get the Adobe Air Auto-Update to work I realized it was a bug with Flex SDK 3.5.  What happens under Flex SDK 3.5 when you run the auto-update is you only see a blank / gray screen pop-up with no wording.   At first I thought it was my code so I tried it using Greg Wilson's sample.  Compiled under Flex SDK 3.5 it doesn't work at all, but then I tried it under 3.4 it works great. I have filed a bug with Adobe, so please vote for it so we can get a quick fix -http://bugs.adobe.com/jira/browse/SDK-24919

Comments (0)

Sep 4 / 3:08pm

Flash Builder Bugs filed with Adobe

James Ward asked me to file bugs for some of the issues we have been seeing with flex builder.  I have posted them here in hopes you will go vote for them.  This is only some of the many issues we are seeing using Flash Builder Allow multiple instances of an AIR app to run at the same time. - There was a previous issue for this which was closed, so I created a new issue with more details. Need to be able to navigate to classes and methods that implement an interface Flex Server ate my bin! - This bug was already in the system, but looks like it is stuck on waiting on Info -  Hopefully voting on it will get it moving. After changing a project type from Flex Server I still can not set my output folder in Flex Build Path Multiple runnable Air applications in the same project using locale causes tabs display name to be null Should be able to navigate into script source with Go to Definition Looking through the bug database it looks like several of the renaming bugs have recently been fixed, so maybe renaming will work in the latest release.

Comments (0)

Sep 4 / 7:56am

Bad Bike Accident Smashes My Face

I had a terrible bike accident that tuned into a major ordeal. I was coming down the hill way to fast on my bike when I fell off the trail in a patch of soft dirt and went flying over the handlebars. I was clipped into my pedals and did not come out in time to catch my self. I ended up taking the entire crash in the face (I am not sure what I did with my hands). What happened after was worst then the accident itself.  I was treated in two regional hospitals that almost killed me.  The my life was saved at a third hospital.   Sadly I found you can not trust our modern medical establishment.  What I learned after is every nurse and doctor should know the ABC's of keeping someone alive - airway, breathing and circulation.  What is scary is two of the hospitals I visited almost killed me by ignore this basic principal.   If you don't mind gory pictures, there are more details and some pictures after the jump.

Comments (0)

Jul 21 / 8:03am

Hey Adobe! What about us Flex developers?

Having developed Flex for several years now I am getting really tired of Adobe's lack of support for developers. I was hoping they would bring at least modest improvements to Flex Builder (now Flash Builder) 4, but it is not much better. Re-factoring support is almost non-existent, something I consider fundamental to the development process. Even simple renaming and moving of classes and variables doesn't work properly.  Code Formatting is still missing.   And why can they still not get proper code navigation?  What I mean is why can you only navigate up the class hierarchy and not down? The most painful part of the development experience for me is how slow visual design is. The visual editor is useless.  So all layout has to be done by hand.  But even making a single change to the layout of a component, it re-compiles the entire project. And there seem to be an endless amount of bugs.  For example we recently found you can not have multiple projects that use locales.  Or odd behavior, like changing the server side support in project properties messes up the entire project. If I where to choose a new UI framework today I would have to seriously re-consider whether to use Flex. I would want to look at the entire development eco-system around alternatives.  I think this is where JavaFX might be able to take the lead.  It all depends on what Oracle does with NetBeans and JavaFX of course, but we can always hope.
Filed under  //  flash builder   flex  

Comments (0)

Mar 14 / 9:13pm

New cloud hosting comparison chart

I put together a cloud hosting comparison chart on Zoho DB.   You can also view the full DB and some reports on Zoho DB.  I need to figure out better ways to visualize the data, so let me know if you have any ideas.  I had to makesome assumptions to try and make the comparisons somewhat equal. Let me know what you think.

Comments (0)

Mar 13 / 3:24pm

Mosso adds Cloud Servers and Cloud Files offerings.

Mosso just announced they are going to be offering cloud servers at $10.95 / Month.  That is about half of the cost of of the competition.  This cloud service is based off their acquisition last year of Slicehost.   It will be interesting to see how similar this offering is to Slicehost.  They have a good reputation for excellent customer service, so hopefully they will keep this up. What else was interesting was they have updated Jungle Disk to support Cloud Files.  The cost currently only includes the monthly storage cost and there is no cost for data transfer.  That would make the price much lower than storing files in Amazon S3 through Jungle Disk.  The cost for direct use of Cloud Files though does include fees for data transfer. Update: I just realized that the cost of Cloud Servers does not include data transfer.  They charge $0.08 / GB for bandwidth in and $0.22 / GB transfer out.  If you assumed 50 GB in and 100 GB out that would add $26 to the total cost.  So it is not as competitive as I originally thought.

Comments (0)

Mar 12 / 1:15pm

Cloud Hosting/VPS Comparison with Amazon EC2 Reserved Instances

Amazon today announced  EC2 Reserved Instances.  This allows companies to pay a one-time fee upfront for a guaranteed reserved instance: Amazon Web Services Blog: Announcing Amazon EC2 Reserved Instances This brings the price down of using EC2 for hosting a web site, similar to using a VPS.  For comparison we put together a chart showing how the price compares to other major VPS providers.  We made a number of assumptions to calculate the monthly price for Amazon EC2.  I have also published  more comparisons on this Google Doc.
Hosting Provider Monthly Cost Ram Storage Transfer
Amazon Reserved Instance * $70.68 1741MB 160GB 50 GB Data In / 100 GB Data Out
Slicehost $70 1024MB 40GB 400GB
Linode $59.95 1080MB 36GB 600GB
RimU ** $67.95 1150MB 16GB 150GB
Media Temple (gs) $80 1024MB*** 100GB 1TB
Media Temple (dv) $67.95 512MB 40GB 1.5TB
GoGrid **** $149.98 512MB? 10GB 200GB
One of the challenges with making these comparisons is each of the services have slightly different offerings and different hardware configurations. For example GoGrid does offer Hardware Load Balancing, but many websites won't need this. Some of the services have more polished control panels and others appeal more to Linux geeks whole like full control. If we were to pick a winner today it would be Linode. They have several unique offerings such as disk images that allow custom partition schemes, configuration profiles to store muliple profiles and the Linode Shell that allows out of band access to your instance for emergency repairs. We are planning to change our hosting provider soon to Linode and will post a review shortly. Let us know what you think. * For Amazon we calculated the price as the base price per month (approx. $27/month) plus the hourly cost of keeping the server running 24/7 in a month. The calculation then is (30 days * 24 hours) * ($0.03 per hour) = $21.6. The base cost then is ($27.083 + $21.6) = $48.68. On top of that we calculated approx data transfer as Data In (50GB * .10) = $5 and Data Out at (100GB * .17) = $17 for a total data transfer cost of $22. ** For RimU we choose the customized option to add extra storage and transfer space *** Media Temple (gs) Ram was based on the advanced specs for GridContainers. **** For GoGrid we used the Business Cloud PrePaid Plan of $99.99 / month plus $49.99 / month for 200GB of outbound transfer

Comments (0)

Ryan Knight  //  Ryan Knight is a Senior Flex and Java consult with 14 years of experience in all aspects of technology.