My favorites | Sign in
Project Logo
                
Blogs:
Feeds:
People details
Project owners:
  nikko.aiello
Project committers:
psmolen

JSpeed

UPDATE

I haven't had much time to work on the AST implementation of this project, so I went back to the original version, that solely used regular expressions. I've posted a pre-release in the downloads section. You can read how to implement it by heading over to the wiki;

JSpeed Implementation

News


The JSpeed engine analyzes different portions of your JS code for fragments which can be optimized, and substitutes them with faster code.

Optimization Example:

    for (i=0;i<1;i++) {
	j = i + 1;
	f = Math.floor(i);
	f = Math.floor(21.4);
}

for (i = 0, j = 0; i < 1000000; i++, j++) {
	if (i == 4) {
		var tmp = i / 2;
		a = Math.abs(i);
	}
	
	if ((i % 2) == 0) {
		var tmp = i / 2;
		tmp = Math.min(i,tmp);
		i++;
	}
}
var arr = new Array(1000000);
for (var i = 0; i < arr.length; i++) {}

before: ~14 ms

  for (var i=0;i<1;++i) {
	j = i + 1;
	f = i>>0;
	f = 21.4>>0;
}

for (var i = 0, j = 0; i < 1000000; ++i, ++j) {
	if (i == 4) {
		var tmp = i >> 1;
		a = i < 0 ? ~i++ : i;
	}
	
	if ((i & 1) == 0) {
		var tmp = i >> 1;
		tmp = i < tmp ? i : tmp;
		i++;
	}
}
var arr = new Array(1000000);
for (var i = 0, arr_len = arr.length; i < arr_len; ++i) {}

after: ~7 ms

Features

Current Optimizations

Contact

If you have any inquiries or even have some optimization ideas to contribute, please send me an e-mail.

Thanks for looking!









Hosted by Google Code