They also mention that the Javascript was written with efficiency in mind
whilst the C++ variant was not.
To quote the section of the website:
"There is another important aspect of the result: our WebGL renderer is
designed to be more efficient than our old C++ DirectX 9 engine from Construct
Classic. When working in C++, it's easy to be lazier - C++ is super fast, so
any code you write will be fast, right? When porting our engine to Javascript,
we knew it was a few times slower than C++ in most benchmarks. This made us
pay much closer attention to performance, as well as taking a smarter overall
strategy. Classic's native engine computes the positions of vertices (the
object corners) when rendering every single sprite. With Construct 2 we
realised these positions are already calculated and cached for use in the
collisions engine. This prevents Construct 2 from having to do any vertex
calculations at all - they are simply copied out from what the collision
engine calculated. So the Javascript engine has less work to do. We thought
this might help slightly close the gap between Javascript and C++; perhaps it
has a lot bigger effect than we thought!
So, as always, performance is complicated. Javascript is not faster than C++ -
this is not what we have proved. Our Javascript engine does less, which helps
explain how with just the right circumstances it can edge ahead of a less
efficiently written C++ engine."
Indeed, a truckload of salt was required :)
Cheers.
P.S. I don't think native Direct X vs. native OpenGL performance won't differ
that much.
On Wednesday 07 November 2012 09:56:36 Kalle Vahlman wrote:
> 2012/11/7 Kalle Vahlman <[email protected]>:
> > 2012/11/7 olivier nyssen <[email protected]>
> >
> >> Hi everyone,
> >>
> >> I just found this article which seems rather interesting:
> >> https://www.scirra.com/blog/102/html5-games-faster-than-native
> >
> > To not confuse things, they are speaking of WebGL rendering, which is
> > not part of the official HTML5 specs.
> >
> > And WebGL is in essence an interface to OpenGL (ES 2.0), so what they
> > are saying is that one OpenGL rendering engine implementation is (in
> > one specific setup) faster than another one.
>
> Oh whoops, the C++ rendering engine was written against DirectX.
>
> So the comparison is basically between an OpenGL rendering engine and
> a DirectX one.
_______________________________________________
General mailing list
[email protected]
https://lists.tizen.org/listinfo/general