Will V8 optimize event sheets?

Discussion and feedback on Construct 2

Post » Thu Mar 31, 2016 7:30 am

I took a look at the compiled exported game to see what event sheet is turned to. I expected it to create a javascript code out of it, but it seems like it creates some kind of a data list of instructions instead, which will be, probably, executed on some kind of ConstructVM. In this case none of the optimizations that V8 or SpiderMonkey can offer are applied, i.e. event sheets run on an ancient JS interpreter speed, or even slower.

Is it true? Please tell me I am wrong...

If no, what is the actual process?
B
6
S
2
Posts: 30
Reputation: 540

Post » Thu Mar 31, 2016 8:41 am

No, Construct 2 takes advantage of the speed of the newest JS interpreters. I think you just exported your game with the minify option checked.
B
137
S
33
G
17
Posts: 1,560
Reputation: 20,797

Post » Thu Mar 31, 2016 10:53 am

Javascript engines like V8 optimise the event engine (the code that runs all the events). Modern JS engines are very well optimised and all of them compile to machine code, so it's pretty fast.
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Thu Mar 31, 2016 11:54 am

Javascript engines like V8 optimise the event engine

Right, it means that Event Engine is compiled to machine code. But what about the event sheet? Does Event Engine interprets the event sheet?

I mean, even early JS engines were written in very fast C++, but what they did (the interpretation of javascript) was very slow.

The same thing here: Event Engine is very fast, but what it does (the interpretation of event sheet) is at the speed of "interpretation".

For example, if I have a loop in event sheet and I use a global variable "foo" of type "number" there, will this variable infer type, like Javascript does or it will stay "dynamic any type var"?
B
6
S
2
Posts: 30
Reputation: 540


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests