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

Improve performance and decrease memory use #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonasGessner
Copy link

The inData and outData were always being allocated even when one of
them was unused. Now they are only allocated if they are actually used.
Same thing with the deviceNames array.

It makes no sense to allocate it
with a capacity of 100. initWithCapacity should only be used when the
exact final size of the array is known. Instead, the array should
dynamically change its size when new elements are added/removed.

And dispatch_one is much quicker than @synchronized.

The inData and outData were always being allocated even when one of
them was unused. Now they are only allocated if they are actually used.
Same thing with the deviceNames array. It makes no sense to allocate it
with a capacity of 100. initWithCapacity should only be used when the
exact final size of the array is known. Instead, the array should
dynamically change its size when new elements are added/removed.
dispatch_one is much quicker than @synchronized.
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.

1 participant