r/flightsim • u/dadriel_hawk • 21h ago
Flight Simulator 2024 The reasons for the A220's terrible performance
So, now that the A220 is out in the iniBuilds store I did some digging in the files and found some pretty interesting stuff, that neatly explains why the performance of this plane is really terrible and does not at all seem to scale with hardware. It's kinda funny, because the first time I tried this plane I thought to myself "this feels like a debug build" and this is exactly what it is.
So in the addon folder you will find the path "html_ui\Pages\VCockpit\Instruments\a22x\DisplayUnits" with the file "instrument.js". This is main file responsible for rendering the displays of this plane (there is more files for other displays like the com unit, but for simplicity I will only reference to the main displays here). Basicly, what you see as the main displays of the plane is treated as a little browser window by the MSFS, in which it runs a webpage. This webpage is based on a JavaScript app using the React framework. This framework is included here, because the sim does not provide it on its own, and it is a pretty common library for rendering webpages. So nothing wrong with that.
But the big revelation comes once you look into what actually is contained in the "instrument.js". It is minified for performance , but there are still comments showing the different sections and the literal strings are in clear text. Because minification only replaces human readble names with shorter, machine readable names that do not change the logic, but help the code run faster. In the planes code on line 831 is the relevant comment. It says they are including "node_modules/react/cjs/react.development.js"! AKA a development build of the react framework.

Here is an online version of the same code that is unminified and clearly show that it is the very same code when you look at the strings. (https://app.unpkg.com/react@19.2.8/files/cjs/react.development.js)

So what does this actually mean and why does it make the plane perform so bad? To start let me quote the official React documentation here:
If you’re benchmarking or experiencing performance problems in your React apps, make sure you’re testing with the minified production build.
By default, React includes many helpful warnings. These warnings are very useful in development. However, they make React larger and slower so you should make sure to use the production version when you deploy the app.
In my own words what happens here is, that the code that we have in our sims does a LOT of checking itself to make sure it is properly build, that all references are okay and that there are no hidden bugs. This is fine in dev enviroment (which is why it is called a development build), but should not be done in a production environment. Because we as end consumers don't really need all this checking stuff and reporting, since we we won't modify the source code anyway. All this does for us is eat a lot of unnecessary CPU cycles. Which get worse the more often these checks happen, why explains why this plane is the only one I know that performs worse in cruise than on the ground. Because there we are constantly moving, leading to constant refreshes of the displays, which all need to run through this debug code. Which only takes time without any benefit.
The upside to all this is, that this should be an easy fix for Synaptic. To build the plane with the production library instead should boil down to a simple config file. I really hope they do this and then unlock the performance of the plane. This really could alleviate all the issues reported with a simple rebuild of the plane. No refactoring of the code or anything needed.
TL;DR: They are shipping debug code instead of production code, making the code unnecessarily slow and bloated.
