HTML5 & HaXe Speed Tests

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

HTML5 & HaXe Speed Tests

Michael Cann
List,

Been running a few more HaXe & HTML5 speed tests this weekend with some interesting results:


It seems that the HaXe version of my Canvas speed tests actually runs faster than the hand-crafted version! 

I have speculated in the post that this is because the HaXe JS can be JIT'ed better than the hand-crafted JS, to I have no idea if thats true or not.

Next ill go back and see what sort of performance I can get out of WebGL + HaXe.

Cheers,

--
Mike Cann
http://www.mikecann.co.uk/


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: HTML5 & HaXe Speed Tests

blackdog

Imo that must be true of V8 given this

http://code.google.com/apis/v8/design.html#prop_access

it creates hidden classes behind the scenes, so the more structure and less reflection is good.

if you  check the mail archives in the last two weeks NC posted a paper on this very subject which was more FF oriented.
bd


On 07/10/2011 03:19 PM, Michael Cann wrote:
List,

Been running a few more HaXe & HTML5 speed tests this weekend with some interesting results:


It seems that the HaXe version of my Canvas speed tests actually runs faster than the hand-crafted version! 

I have speculated in the post that this is because the HaXe JS can be JIT'ed better than the hand-crafted JS, to I have no idea if thats true or not.

Next ill go back and see what sort of performance I can get out of WebGL + HaXe.

Cheers,

--
Mike Cann
http://www.mikecann.co.uk/





-- 
Simplicity is the ultimate sophistication. ~ Leonardo da Vinci

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: HTML5 & HaXe Speed Tests

Dion Whitehead Amago
Nice.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: HTML5 & HaXe Speed Tests

Tony Polinelli
one small difference between the haxejs and js is that in your js code, you are using setTimeout(), it needs to reset this every frame.

using setInterval bumped my fps from 6 to 7  (not js and haxejs both get 7, for 5000)

function update()
{
var context = canvas.getContext("2d");
context.fillStyle = "#eeeeff";
context.fillRect(0,0,800,800);

for(var i=0; i<numCrawlers; i++)
{
var c = crawlers[i];
c.x+=c.vx;
c.y+=c.vy;
if (c.x < 0) { c.x = 0; c.vx = -c.vx; }
if (c.x > 800) { c.x = 800; c.vx = -c.vx; }
if (c.y < 0) { c.y = 0; c.vy = -c.vy; }
if (c.y > 800) { c.y = 800; c.vy = -c.vy; }
context.drawImage(icon32, c.x, c.y);
}
}
reset();
setInterval("update()",16);





On Mon, Jul 11, 2011 at 10:37 AM, Dion Amago <[hidden email]> wrote:
Nice.

--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: HTML5 & HaXe Speed Tests

Michael Cann
Ah, whats the difference between the two? 

Ye, after posting I tried it in firefox with totally different results. Each test was much slower (I had to reduce the count to 1000 crawlers each) and this time the JS and the HaXe version were the same speed and both beat the Jeash version by a small margin.

So I guess v8 is doing some seriously impressive stuff under the covers (ill be giving that a link a good read laters, cheers blackdog).

Mike

On 11 July 2011 03:35, Tony Polinelli <[hidden email]> wrote:
one small difference between the haxejs and js is that in your js code, you are using setTimeout(), it needs to reset this every frame.

using setInterval bumped my fps from 6 to 7  (not js and haxejs both get 7, for 5000)

function update()
{
var context = canvas.getContext("2d");
context.fillStyle = "#eeeeff";
context.fillRect(0,0,800,800);

for(var i=0; i<numCrawlers; i++)
{
var c = crawlers[i];
c.x+=c.vx;
c.y+=c.vy;
if (c.x < 0) { c.x = 0; c.vx = -c.vx; }
if (c.x > 800) { c.x = 800; c.vx = -c.vx; }
if (c.y < 0) { c.y = 0; c.vy = -c.vy; }
if (c.y > 800) { c.y = 800; c.vy = -c.vy; }
context.drawImage(icon32, c.x, c.y);
}
}
reset();
setInterval("update()",16);





On Mon, Jul 11, 2011 at 10:37 AM, Dion Amago <[hidden email]> wrote:
Nice.

--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org



--
Mike Cann
http://www.mikecann.co.uk/


--
haXe - an open source web programming language
http://haxe.org