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

Making less allocations #14

Open
qjgn opened this issue Sep 14, 2020 · 1 comment
Open

Making less allocations #14

qjgn opened this issue Sep 14, 2020 · 1 comment

Comments

@qjgn
Copy link
Contributor

qjgn commented Sep 14, 2020

Locks are used to make RTPacket.cs thread safe. In order to have one thread executing the SetData method while another thread could poll the parsed data through different Get methods. The design dependnds on the .ToList method for making shallow copies of the shared data. This is working right now because most components simply allocate new arrays for every packet. This creates garbage which is no good for realtime applications.

We could conserve allocations by reusing lists instead of depending on fresh arrays. We would also need to make deep copies of the structures instead of using .ToList in the Get methods.

@qjgn qjgn changed the title Flawed locks Making less allocations Sep 15, 2020
@qjgn
Copy link
Contributor Author

qjgn commented Nov 27, 2020

#21 Is allowing the user to re-use lists when fetching component data.

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

1 participant