Jump to content
The simFlight Network Forums

speed of FSUIPC_Read


Recommended Posts

Hi Pete,

I have to read 121 bytes, 16 times per second, and use this call:

FSUIPC_Read(dwoffset, 121, pDest, &Res);

Does it make sense to enlarge the size to 128? I mean will the read operation be more efficient with a blocksize of 128?

Link to comment
Share on other sites

  • 2 weeks later...

Does it make sense to enlarge the size to 128? I mean will the read operation be more efficient with a blocksize of 128?

No, just read what you need. If you only need 2 of those bytes, 119 apart, use two separate reads. They are combined in the FSUIPC_Process call in any case and only the Process call actually does anything that takes time.

Pete

Link to comment
Share on other sites

Hi Pete,

I'm sorry for not being very specific.

I meant: I call the FSUIPC_read first (with 121 bytes) and directly after that I call the FSUIPC_process function.

So the question actually should be: does it make sense (speed wise) to read 128 bytes in order for FSUIPC_process to be more efficient?

Link to comment
Share on other sites

Hi Pete,

I'm sorry for not being very specific.

I meant: I call the FSUIPC_read first (with 121 bytes) and directly after that I call the FSUIPC_process function.

So the question actually should be: does it make sense (speed wise) to read 128 bytes in order for FSUIPC_process to be more efficient?

I had assumed you meant with a Process call -- my answer included that assumption. So no, only ever read what you need, even if that means splitting the Read into many Reads. Each offset may invokde separate procedures in FSUIPC and FS.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

Thanks. Splitting up Reads is no option. I only read once and process (16 times a second).

So I understand that calling after every 60 msec

FSUIPC_Read(dwoffset, 128, pDest, &Res);

FSUIPC_Process();

is not faster then

calling every 60 msec:

FSUIPC_Read(dwoffset, 121, pDest, &Res);

FSUIPC_Process();

So it makes no sense enlarging my blocksize with dummies from 121 to 128.

Link to comment
Share on other sites

Hi Pete,

Thanks. Splitting up Reads is no option. I only read once and process (16 times a second).

Meaning you use all 121 bytes, every one is important?

So I understand that calling after every 60 msec

FSUIPC_Read(dwoffset, 128, pDest, &Res);

FSUIPC_Process();

is not faster then

calling every 60 msec:

FSUIPC_Read(dwoffset, 121, pDest, &Res);

FSUIPC_Process();

If anything the 128 byte read could be slower because of the extra 7 bytes -- it depends what they are used for. You need to understand that many of the offset values are really only TOKENS for a value -- the values may have to be obtained by more processing.

So it makes no sense enlarging my blocksize with dummies from 121 to 128.

No, it makes it worse if anything. Same if in your 121 bytes there are some you don't need.

I don't know how else to say the same thing each time! ;-)

Regards

Pete

Link to comment
Share on other sites

Meaning you use all 121 bytes, every one is important?

Yes! These offsets are FSCONV offsets. They represent hardware switches. Note I'm only using your offsets as mailboxes, they are not 'real FSUIPC offsets' in the sense that they represent something in FS9. So what you're saying about differences in processing needed to obtain values is not relevant here.

I don't know how else to say the same thing each time! ;-)

Much appreciated, but I want to be as precise as possible. We are both talking within our own 'mind sets'.

Link to comment
Share on other sites

Note I'm only using your offsets as mailboxes, they are not 'real FSUIPC offsets' in the sense that they represent something in FS9. So what you're saying about differences in processing needed to obtain values is not relevant here.

Okay. Got you. If the extra 7 bytes are similar, then it makes no difference, then, reading 121 or 128. ;-)

Best

Pete

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.