Thanks to visit codestin.com
Credit goes to github.com

Skip to content

reduce ReadSimVars() count to improve performance #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

cpuwolf
Copy link
Contributor

@cpuwolf cpuwolf commented May 3, 2022

proposal of issue #9 , This has been tested on device with PilotEdge.net ATC
https://x-plane.vip/quickmade/qg1k/

  1. use std::list instead of std::vector, for circular iteration
  2. list max 5 SimVars reading in every frame
  3. VimVars clean() needs update list iterator

1. use std::list instead of std::vector, for circular iteration
2. list max 5 SimVars reading in very frame
3. VimVars clean() needs update list iterator
@cpuwolf
Copy link
Contributor Author

cpuwolf commented May 3, 2022

MobiFlightWasmModule.zip
Engineering Build is attached

use 12 for a while
@DocMoebiuz
Copy link
Collaborator

Hi! Very interesting idea. I would like to make the number of vars read at once configurable.

I think by default it should behave the way it used to behave and reading all vars at once.

But with sending a message like MF.SimVars.SetVarLimit we could then limit it to a desired number.

@Koseng
Copy link
Collaborator

Koseng commented May 14, 2022

Hi,
I also like the concept. In #9 I reported my tests.

I agree making it configurable is a good idea.

I disagree in not setting a limit. My tests show it suddenly starts and gets worse and worse with numbers of variables increasing. I think it is hard for someone to figure out that suddenly the number of variables leads to stutters.

  • I would limit the number of read variables per frame to something like 30 per default. Then with 30 FPS you can update 900 variables each second or 200 variables each 222ms.
  • I don't know whether the typical mobiflight user has more than 200 active variables?

@cpuwolf
Any special reason to switch to a list and use a list iterator?
We could just stay with the vector and iterate an int index. Performance wise this should be better.

@cpuwolf
Copy link
Contributor Author

cpuwolf commented May 16, 2022

@Koseng list iterator, because I am newbie of vector, I failed to iterate an int index. that would be great if you can come up with better solution. I agree, the limitation can be configurable

@DocMoebiuz
Copy link
Collaborator

@cpuwolf - Thanks for the preparation of this. Please take a look at: #13 - I made some changes and additions, it would be great if you could test it too.

I will close this PR.

@DocMoebiuz DocMoebiuz closed this Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants