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

Reduce unnecessary allocations and sorting to improve performance #41

Merged
merged 2 commits into from
Aug 13, 2022
Merged

Conversation

fumin
Copy link
Contributor

@fumin fumin commented Aug 13, 2022

As shown in the pprof graph to be attached in the pull request,
the previous implementation has the following time spent:

gcBgMarkWorker 24.37%
mallocgc 15.21%
sort.Sort 9.06%
gcWriteBarrier 7.2%

which adds up to almost half the running time.

before

The pprof graph after this change (to be also attached) shows that these memory allocations
and sorting operations are indeed reduced.

after

As shown in the pprof graph to be attached in the pull request,
the previous implementation has the following time spent:

gcBgMarkWorker 24.37%
mallocgc       15.21%
sort.Sort      9.06%
gcWriteBarrier 7.2%

which adds up to almost half the running time.

The pprof graph after this change (to be also attached) shows that these memory allocations
and sorting operations are indeed reduced.
rtree.go Show resolved Hide resolved
@dhconnelly dhconnelly merged commit a8d3d94 into dhconnelly:master Aug 13, 2022
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.

2 participants