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 #1

Open
2 of 5 tasks
mucaho opened this issue Sep 13, 2014 · 0 comments
Open
2 of 5 tasks

Improve performance #1

mucaho opened this issue Sep 13, 2014 · 0 comments

Comments

@mucaho
Copy link
Owner

mucaho commented Sep 13, 2014

As this library is also intended to work on Android, performance should be optimized where applicable

  • send only 1 packet (no duplicate ack/last ack fields) for multiple for retransmits
    -> add Controller.send(Collection<MultiKeyValue>): Packet
    -> add Controller.receive(Packet with Collection<MultiKeyValue>): Object
  • make sure that there is minimal object allocation inside scopes -> extract such local variables as fields
  • add object pools for Packet, MultiKeyValue, Iterator and co instead of instantiating new objects
    -> update serializer object creation strategy to use object pools
  • use practical initialCapacity parameters during collection initialization
  • use a rolling fixed size queue for pending acks, eg. a 256 size queue indexed by sequence number mod 256. changing to plain array much of the NavigableMap functionality is lost -> rather investigate alternative collection libraries with near zero garbage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant