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

Reassembler perfomance improvement #60

Open
dselyuzhitskiy opened this issue Nov 22, 2019 · 0 comments
Open

Reassembler perfomance improvement #60

dselyuzhitskiy opened this issue Nov 22, 2019 · 0 comments

Comments

@dselyuzhitskiy
Copy link

Hello!

I found, that on every new event reassembler sort sequenceNumSlice, which leads perfomance issues on high audit rate limits. I think it can be improved if make sort only if difference between new sequence and last:

l.seqs = append(l.seqs, seq)

if len(l.seqs) > 1 {
	lastSeq := l.seqs[len(l.seqs)-2]

	diff := abs(int64(seq) - int64(lastSeq))
	if diff > maxSortRange || diff < 0 {
		l.seqs.Sort()
	}
}

What do you think about such improvement?

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