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

Use LinkedLists in IndexCalculator, optimise algorithm #126

Merged

Conversation

onliner10
Copy link
Contributor

IndexCalculator used to cause a lot of memory allocations mainly due to the fact it was using lists. So, for each insert/update it had to perform full array copy twice (RemoveAt, InsertAt) which is expensive. Since we use LinkedList now, this is no longer an issue. Also, list iterations were reduced significantly to a constant of three (one for removals, one for updates, one for adds).
To reduce complexity in IndexCalculator, I also created ChangesReducer which reduces N changes for a given key into 1, which should also alter performance in a positive way.
Additionaly, I modified SortFixture to sort by property instead of a key so that moves are possible.
I tested this solution throughly and, according to my knwoledge, it seems working

@onliner10
Copy link
Contributor Author

I managed to fix algorithm to handle refreshes, therefore fixing failing test

@RolandPheasant RolandPheasant merged commit 3a091ae into reactivemarbles:master Jul 4, 2018
@RolandPheasant
Copy link
Collaborator

I've merged this is because it looks good, there are lots of unit tests and on my local testing with dynamic trader there was a noticeable side by side performance improvement.

What we desperately need now is some proper bench marking incorporated into dd

RolandPheasant added a commit that referenced this pull request Aug 30, 2018
…[will restore later when the error is fixed]

2. Bump version
3. Add release notes
@lock lock bot locked and limited conversation to collaborators Jul 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants