Skip to content
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

SCA: How to set buffer size #61

Open
Chromowolf opened this issue Aug 24, 2021 · 7 comments
Open

SCA: How to set buffer size #61

Chromowolf opened this issue Aug 24, 2021 · 7 comments

Comments

@Chromowolf
Copy link
Contributor

Is there a guide about what is / how to set the buffer size?
My map has over 20 SCA variables, but the buffer size is 300 (default). I don't know whether this is proper. What consequence can be caused by improper buffer size settings?

@Buizz
Copy link
Owner

Buizz commented Aug 24, 2021

Usually, one variable consumes 4 bytes. If it consumes the maximum, it consumes 8 bytes.
There's nothing wrong with having a large buffer, so you can just leave it as it is.

If the variable exceeds the size of the buffer, an overflow can occur and interrupt the trigger flow of the map.

@Chromowolf
Copy link
Contributor Author

Chromowolf commented Aug 25, 2021

For example, I got 2 SCA variables, (1 variable and 1 array):

const x = PVariable();  // 1 variable
const y = EUDArray(40);  // Array of length 5

How many variables is this equivalent to? 6, or 48?
How many bytes does it consume? 4x6=24 bytes, or 4x48=192 bytes?

@Buizz
Copy link
Owner

Buizz commented Aug 25, 2021

x is 1
y is 40/8 = 5
So 6 is correct.

min 6 X 4=24 ~ max 6 X 8=48

However, it is good enough to leave it around 100.
The buffer size has almost no effect on the actual map capacity. Because this size is compressed.

@Chromowolf
Copy link
Contributor Author

I see. thx!

@Chromowolf
Copy link
Contributor Author

Chromowolf commented Aug 30, 2021

Is it possible to add a new feature: let EE3 automatically detect the number of SCA variables and calculate the buffer size needed?

@Buizz
Copy link
Owner

Buizz commented Aug 31, 2021

To do that, we need a parser that can keep track of the length of the array.

@Chromowolf
Copy link
Contributor Author

Maybe use regular expression? May not be hard to do :P

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

No branches or pull requests

2 participants