BigDecimalの演算速度を検証しました。

検証の結果、以下のことがわかりました。
・ div/reminder は遅い
・ doubleのコンストラクタを使うと遅い
・ longのコンストラクタでも毎回newすると計算時間が増える。(まぁあたりまえだけど)
・ 桁が増えると遅くなる

BigDecimalは桁数に応じて内部データの持ち方を変えるようです。
桁が大きくなればなるほど遅くなると思われます。
データがintで表せる数である場合とlongで表せる数値の場合ではガクッと計算速度が変わります。

検証方法:
Core i 5 2500K 3.2GHz のマシンで100万回単純計算

検証コード:

import java.math.BigDecimal;
import java.math.MathContext;

public class Main {

	public static void main(String[] args) {
		long start,end;
		int repeat = 10000 * 100;

		start = System.currentTimeMillis();
		testAdd1D(repeat, 100000);
		end = System.currentTimeMillis();
		System.out.println("add1 loop内new double constructor 桁少なめ ms:" + (end - start));

		start = System.currentTimeMillis();
		testAdd1D(repeat, Long.MAX_VALUE);
		end = System.currentTimeMillis();
		System.out.println("add1 loop内new double constructor 桁多め ms:" + (end - start));

		start = System.currentTimeMillis();
		testAdd1L(repeat, 100000);
		end = System.currentTimeMillis();
		System.out.println("add1 loop内new long constructor 桁少なめ ms:" + (end - start));

		start = System.currentTimeMillis();
		testAdd1L(repeat, Long.MAX_VALUE);
		end = System.currentTimeMillis();
		System.out.println("add1 loop内new long constructor 桁多め ms:" + (end - start));

		start = System.currentTimeMillis();
		testAdd2(repeat, 100000);
		end = System.currentTimeMillis();
		System.out.println("add2 loop外new 桁少なめ ms:" + (end - start));

		start = System.currentTimeMillis();
		testAdd2(repeat, Long.MAX_VALUE);
		end = System.currentTimeMillis();
		System.out.println("sum2 loop外new 桁多め ms:" + (end - start));

		start = System.currentTimeMillis();
		testSub(repeat);
		end = System.currentTimeMillis();
		System.out.println("sub ms:" + (end - start));

		start = System.currentTimeMillis();
		testMul(repeat);
		end = System.currentTimeMillis();
		System.out.println("mul ms:" + (end - start));

		start = System.currentTimeMillis();
		testDiv(repeat);
		end = System.currentTimeMillis();
		System.out.println("div ms:" + (end - start));

		start = System.currentTimeMillis();
		testMod(repeat);
		end = System.currentTimeMillis();
		System.out.println("mod ms:" + (end - start));
	}

	public static BigDecimal testAdd1D(int repeat, double value) {
		BigDecimal sum = BigDecimal.valueOf(23423234.2344);
		for ( int i = 0; i < repeat; i++ ) {
			sum = sum.add(new BigDecimal(value));
		}
		return sum;
	}
	public static BigDecimal testAdd1L(int repeat, long value) {
		BigDecimal sum = BigDecimal.valueOf(23423234.2344);
		for ( int i = 0; i < repeat; i++ ) {
			sum = sum.add(new BigDecimal(value));
		}
		return sum;
	}

	public static BigDecimal testAdd2(int repeat, double value) {
		BigDecimal v = BigDecimal.valueOf(value);
		BigDecimal sum = BigDecimal.valueOf(23423234.2344);
		for ( int i = 0; i < repeat; i++ ) {
			sum = sum.add(v);
		}
		return sum;
	}

	public static BigDecimal testSub(int repeat) {
		BigDecimal sum = BigDecimal.valueOf(234342749.2342342);
		for ( int i = 0; i < repeat; i++ ) {
			sum = sum.subtract(new BigDecimal(1234234.234));
		}
		return sum;
	}

	public static BigDecimal testMul(int repeat) {
		BigDecimal d2 = BigDecimal.valueOf(1123234242.3421);
		for ( int i = 0; i < repeat; i++ ) {
			d2.multiply(new BigDecimal(122343.4));
		}
		return null;
	}

	public static BigDecimal testDiv(int repeat) {
		MathContext mc = new MathContext(20);
		BigDecimal d2 = BigDecimal.valueOf(122343412.3421);
		for ( int i = 0; i < repeat; i++ ) {
			d2.divide(new BigDecimal(12234.34), mc);
		}
		return null;
	}

	public static BigDecimal testMod(int repeat) {
		MathContext mc = new MathContext(20);
		BigDecimal d2 = BigDecimal.valueOf(1223434.123421);

		for ( int i = 0; i < repeat; i++ ) {
			d2.remainder(new BigDecimal(123423.234234),mc);
		}
		return null;
	}
}

出力:
add1 loop内new double constructor 桁少なめ ms:327
add1 loop内new double constructor 桁多め ms:625
add1 loop内new long constructor 桁少なめ ms:30
add1 loop内new long constructor 桁多め ms:90
add2 loop外new 桁少なめ ms:18
sum2 loop外new 桁多め ms:78
sub ms:411
mul ms:444
div ms:971
mod ms:1275

AdvancedDataGridにXMLをdataProviderとして与えてツリー表示をする場合などに、HierarchicalDataを使います。
HierarchicalData#childrenFiedlで子ノードを格納する要素名を指定できるのですが、特に表示用に作ったわけでもないXMLである場合、子ノードを
格納する要素の名前が同じであるとは限りません。この場合、childrenFieldでは対応できなくなります。
そこで、子ノードの判定を行う関数を指定できるIHierarchicalDataの実装があると便利です。

というわけで作ってみました。コンストラクタで判定関数を指定できるようになっています。
あと、Xmlに特化している分、HierarchicalDataより高速に動くというメリットもあります。(たぶん)

import flash.events.EventDispatcher;
import mx.events.CollectionEvent;
import mx.events.CollectionEventKind;
import mx.collections.IHierarchicalData;

public class XmlHierarchicalData extends EventDispatcher implements IHierarchicalData
{
	private var _source:XMLList;
	private var getChildrenFieldName:Function;

	public function XmlHierarchicalData(value:XMLList, childrenNameFunc:Function) {
		source = value;
		getChildrenFieldName = childrenNameFunc;
	}

	public function get source():XMLList
	{
		return _source;
	}

	public function set source(value:XMLList):void
	{
		_source = value;

		var event:CollectionEvent = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
		event.kind = CollectionEventKind.RESET;
		dispatchEvent(event);
	}

	public function canHaveChildren(node:Object):Boolean
	{
		if (node == null) {
			return false;
		}
		var list:XMLList = getChildren(node) as XMLList;
		return list.length() > 0;
	}

	public function hasChildren(node:Object):Boolean
	{
		if (node == null) {
			return false;
		}
		var children:XMLList = XMLList(getChildren(node));
		return children.length() > 0;
	}

	public function getChildren(node:Object):Object
	{
		if ( node == null ) {
			return null;
		}
		var xml:XML = XML(node);
		var name:String = String(xml.localName());
		var childrenField:String = getChildrenFieldName(xml) as String;
		return xml.child(childrenField).*;
	}

	public function getData(node:Object):Object
	{
		return node;
	}

	public function getRoot():Object
	{
		return _source;
	}
}

FlexのTitleWindowをリサイズ可能にする方法が各所でとりあげられています。
しかし、低スペックマシンで中身が一杯あるTitleWindowをリサイズするとマウス移動のたびに再描画が発生して激重だったりします。
そこで、代替オブジェクトを使ってMOUSE_UPイベントが来たときだけリサイズすることで、この問題を回避することを考えました。

とりあえず、代替オブジェクトを使ってリサイズするTitleWindowが下記です。(リサイズの実装は適当)
これを各所で紹介されているリサイズの実装と組み合わせれば、軽いリサイズができると思います。

<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
			   xmlns:s="library://ns.adobe.com/flex/spark"
			   xmlns:mx="library://ns.adobe.com/flex/mx" width="680" height="494"
			   initialize="titlewindow1_initializeHandler(event)">
	<fx:Declarations>
		<!-- 非ビジュアルエレメント (サービス、値オブジェクトなど) をここに配置 -->
	</fx:Declarations>
	<fx:Script>
		<![CDATA[
			import mx.core.*;
			import mx.events.CloseEvent;
			import mx.events.FlexEvent;
			import mx.managers.PopUpManager;

			private var dragProxy:Sprite;

			protected function titlewindow1_initializeHandler(event:FlexEvent):void
			{
				dragProxy = new Sprite();
				this.addEventListener(CloseEvent.CLOSE, onClose);
				this.systemManager.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
				this.systemManager.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
				this.systemManager.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
				this.rawChildren.addChild(dragProxy);
			}

			private function onClose(event:Event):void {
				PopUpManager.removePopUp(this);
			}

			private var dragged:Boolean = false;
			private var currentRect:Rectangle = null;
			private var pos:Point = null;
			private function onMouseDown(event:MouseEvent):void {
				dragged = true;
				currentRect = this.getRect(this);
				pos = new Point(currentRect.width, currentRect.height);
				drawProxy();
				updateLogArea();
			}
			private function onMouseUp(event:MouseEvent):void {
				if ( dragged ) {
					this.width = dragProxy.width;
					this.height = dragProxy.height;
					dragProxy.graphics.clear();
				}
				dragged = false;
			}
			private function onMouseMove(event:MouseEvent):void {

				if ( dragged ) {
					currentRect.width += event.localX - pos.x;
					currentRect.height += event.localY - pos.y;
					pos.x = event.localX;
					pos.y = event.localY;

					drawProxy();
					updateLogArea();
				}

			}

			private function drawProxy():void {
				dragProxy.graphics.clear();
				dragProxy.graphics.lineStyle(3, 0xff0000);
				dragProxy.graphics.moveTo(currentRect.x,currentRect.y);
				dragProxy.graphics.lineTo(currentRect.x + currentRect.width, currentRect.y);
				dragProxy.graphics.lineTo(currentRect.x + currentRect.width, currentRect.y + currentRect.height);
				dragProxy.graphics.lineTo(currentRect.x, currentRect.y + currentRect.height);
				dragProxy.graphics.lineTo(currentRect.x, currentRect.y);
			}

			private function updateLogArea():void {
				logarea.text = currentRect.toString();
				logarea.text += "\ndragged:" + dragged.toString();
			}

		]]>
	</fx:Script>
	<s:TextArea id="logarea" x="49" y="63" width="209" height="277"/>
</mx:TitleWindow>

AdvancedDataGridにComboBoxを表示するためのコンポーネント「AdvancedDataGridComboBoxColumn」を作成してみました。
実際にComboBoxを使う場合、[{ラベル,データ値},{ラベル,データ値}・・・] というデータ構造でComboBoxに表示するラベルと実際の値を表現できると便利です。
AdvancedDataGridComboBoxColumnはそこらへんも考慮に入れて汎用的な作りにしました。
_labelFunction()内のデータ値の比較は少し乱暴(toStringして===)かもしれませんが、ほとんどの場合はこれで足りると思います。

パッケージ:net.devneko.components
ファイル名:AdvancedDataGridComboBoxColumn.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:AdvancedDataGridColumn xmlns:fx="http://ns.adobe.com/mxml/2009"
						   xmlns:s="library://ns.adobe.com/flex/spark"
						   xmlns:mx="library://ns.adobe.com/flex/mx"
						   editorDataField="value" labelFunction="_labelFunction">
	<fx:Script>
		<![CDATA[
			// ComboBoxの値とラベルのペアー
			[Bindable]
			public var valueLabelMap:Array = [];
			// valueLabelMapの値を示すフィールドの名前
			[Bindable]
			public var comboBoxDataField:String = "data";
			// valueLabelMapのラベルを示すフィールドの名前
			[Bindable]
			public var comboBoxLabelField:String = "label";
			// valueLabelMapに該当しない値であるときのラベル
			public var defaultLabel:String = "";
			// コンボボックスで値を設定していない場合の値
			public var comboBoxDefaultValue:Object = "";

			private function _labelFunction(item:Object, column:AdvancedDataGridColumn):String
			{
				var value:String = item[column.dataField].toString();
				for each ( var i:Object in valueLabelMap ) {
					if ( value === i[comboBoxDataField].toString() ) {
						return i[comboBoxLabelField];
					}
				}
				return defaultLabel;
			}
		]]>
	</fx:Script>

	<mx:itemEditor>
		<fx:Component>
			<mx:ComboBox dataProvider="{outerDocument.valueLabelMap}"
						 labelField="{outerDocument.comboBoxLabelField}">
				<fx:Script>
					<![CDATA[
						override public function get value():Object {
							if ( selectedItem != null ) {
								return selectedItem[outerDocument.comboBoxDataField];
							}
							return outerDocument.comboBoxDefaultValue;
						}
					]]>
				</fx:Script>
			</mx:ComboBox>
		</fx:Component>
	</mx:itemEditor>
</mx:AdvancedDataGridColumn>

使用例

<?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/mx" minWidth="955" minHeight="600"
			   xmlns:components="net.devneko.components.*">
	<fx:Script>
		<![CDATA[
			[Bindable]
			public var src:XML = <root>
				<value>
					<col1>1</col1>
					<col2>2</col2>
				</value>
				<value>
					<col1>2</col1>
				</value>
				</root>;

			[Bindable]
			public var map:Object = [
				{ code: 0, label: "AAA" },
				{ code: 1, label: "BBB" },
				{ code: 2, label: "CCC" }];

		]]>
	</fx:Script>

	<mx:AdvancedDataGrid id="adg1" x="84" y="66" width="420" height="314" designViewDataType="tree" dataProvider="{src.value}" editable="true">
		<mx:columns>
			<mx:AdvancedDataGridColumn dataField="col1" headerText="列 1"/>
			<components:AdvancedDataGridComoBoxColumn dataField="col2" headerText="retu4" valueLabelMap="{map}" comboBoxDataField="code" />
		</mx:columns>
	</mx:AdvancedDataGrid>

</s:Application>

FlexってAdobe製品を買わないと開発できないと思ってたんですが、そうでもないみたいです。
Flexの開発に必要な基本ツール群であるFlexSDKはAdobeのサイトで無料配布されています。
かといって、IDEがないんじゃ辛いわけですが、それもありました。
FlashDevelopというオープンソースIDEがあるようです。

とりあえずFlashDevelopとFlexSDKをダウンロード。
FlashDevelopはインストーラ形式なのでNextを押しまくって標準インストール。
FlexSDKは解凍して当方Windows7(64bit)なのでAppData\Roamingに放り込みました。

FlashDevelopを起動して[Project -> New Project -> Flex4 Project]を選びウィザードに従ってプロジェクトを作成。
とりあえず実行してみると Java のスタックトレースが吐かれました。 BadImageFormatException です。
どうやら JAVA_HOME に設定している JRE が 64bit版になっているのがいけないようなので
JAVA_HOMEを32bit版に向けてFlashDevelopを再起動したところうまくいきました。

Hello WorldがわりにMain.mxmlに適当にどこかからもってきた下記のコードを貼りつけて実行するとちゃんとでました。

<mx:Button id=”myButton” label=”I’m a button!” />