Article: Article: Converting an existing aircraft - Performance

In the previous article, we discussed how convert a basic XLua aircraft to JetScript, and got all the functionality of the existing plugin working. We can go a step further, and improve performance by using more of JetScript's APIs, and we should see an improvement in frame rate for some users.

Performance overview

Performance is usually obtained in two ways:

Do work faster: Jetscript uses the same V8 interpreter and JIT that Google Chrome uses; this helps it runs your plugin code with great performance by default.

Do less work: The best way to increase performance of a Jetscript plugin is to do less work every frame. Run less code, or run the code less often. Jetscript also provides some features, like change callbacks, that reduce the need to run your code every frame. Let's start there.

Antipattern: polling isn't performant

TODO; can the c172 fuel handle be used as an example?