Performance of multiple JS resources

Hello developers,

I was planing to write a bigger project in Typescript.
I’m just more experienced in the Js world and I don’t really care about the Runtime overhead.
But since I wanted to still take advantage of fivem’s resource loading and make development a bit easier for small features, I was planing to transpile modules of my system in separate fivem resources next to the core.

Now I’m realizing that every resource has that runtime overhead and I’m really not sure if that could be a problem or not matter at all. If I have a lot of resources written in JS

Does anyone have experience with multiple js resources?
Should I consider bundling everything into one resource or is the difference of performance in the end not noticeable?

I still suggest Lua or C# for scripting purposes as the V8 engine brings a lot of overhead especially for small project or resources. So I recommend going with Lua or C# for scripting.

The performance overhead isn’t noticeable (the same goes for C# rt1), so you should be fine. The only time you will have this overhead is whenever you’re using setTick, setInterval, setTimeout.

As per usual the big disclaimer should be don’t worry about the runtime overhead and use whichever language you like the most, because no one is going to notice a difference.

2 Likes