Jump to content
The simFlight Network Forums

Performance question


Recommended Posts

Pete,

 

One question to the expert: Is it in principal better to have for all programmed stuff one LUA thread, where you pack all your code and all your event handling into it, or is it better to create seperate small LUA scripts, which you start in seperate threads from one master LUA script?

 

I raise this question in terms of performance, as this is even on the top machines always a factor in the flightsim environment. I run P3d 2.4 on Win 7 64-bit. And if you have a multi-monitor, every single frame counts. Do you have a hint out of your long-time experience? My modules are quite independent (controlling mainly my GoFlight hardware and showing several panels and cameras). So there is no big need for sharing variables between them. At the moment I have seperate modules (around 50-80 depending on the aircraft I fly) running in parallel.

 

Any input from you (or the LUA community) is appreciated.

 

Rgds

Reinhard

 

Link to comment
Share on other sites

Pete,

 

One question to the expert: Is it in principal better to have for all programmed stuff one LUA thread, where you pack all your code and all your event handling into it, or is it better to create seperate small LUA scripts, which you start in seperate threads from one master LUA script?

 

I raise this question in terms of performance, as this is even on the top machines always a factor in the flightsim environment. I run P3d 2.4 on Win 7 64-bit. And if you have a multi-monitor, every single frame counts. Do you have a hint out of your long-time experience? My modules are quite independent (controlling mainly my GoFlight hardware and showing several panels and cameras). So there is no big need for sharing variables between them. At the moment I have seperate modules (around 50-80 depending on the aircraft I fly) running in parallel.

 

Any input from you (or the LUA community) is appreciated.

 

If they are all event based or looping type plug-ins, not ones loaded and unloaded each time they are used, then the difference is only that multiple small ones will be using multiple threads. If they are dormant (sleeping or waiting for events) most of the time this will not really matter too much, though Windows does have an upper limit to the total number of threads in the system you wouldn't get anywhere near that.

 

I think that design considerations -- ease of use, ease of maintenance, clarity - would be more important here than the neglogible difference in performance. I'd group functions dealing with variatins of the same things, but separate those with very different purposes or destinies.

 

Pete

Link to comment
Share on other sites

Pete,

 

Perfect - this answers my question. All modules are event based just waiting for some hardware buttons or other inputs. I am fine with the modular approach as the single scripts are easier to maintain. The only thing where I felt uncertain, was the possible overhead for starting several LUA environments in parallel.

 

Thanks!

Reinhard

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.