JavaScript の Array#sort は、比較関数を渡さない場合、各要素は文字列として比較され、並び替えられます。これに関して、IE などで用いられている JScript では、文字列化を一度しか行わず結果をキャッシュしている、すなわち内部的にシュワルツ変換 (Schwartzian transform) を行っているようで、配列要素の toString メソッドを適宜調整することによりソートを高速化できるというのが IT 戦記で触れられていました。 これはつまり、通常次のようにするところを、 // 比較関数 function C(order) { this.order = order; } array.sort(function (a, b) { return a.order - b.order; }); 次のようにすると JScript で高速化が図れるというものです。 //