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

perf: improve the way we check if refs are not pointing to commits #780

Merged
merged 2 commits into from
Apr 5, 2019
Merged

perf: improve the way we check if refs are not pointing to commits #780

merged 2 commits into from
Apr 5, 2019

Conversation

erizocosmico
Copy link
Contributor

Fixes #775
Fixes #777

Before, each time we got a new reference, we were checking if it
pointed to a commit. This incurred in a performance penalty and
an increase of 2x in memory usage and 4x in allocations, as more
objects were being read from the repository.

Instead, now we use the already present resolveCommit to check it
the moment we get the object, since we have to get it anyway.
This way, we have the exact same behaviour without having any
performance penalty or memory usage increase.

Signed-off-by: Miguel Molina miguel@erizocosmi.co

Fixes #775
Fixes #777

Before, each time we got a new reference, we were checking if it
pointed to a commit. This incurred in a performance penalty and
an increase of 2x in memory usage and 4x in allocations, as more
objects were being read from the repository.

Instead, now we use the already present resolveCommit to check it
the moment we get the object, since we have to get it anyway.
This way, we have the exact same behaviour without having any
performance penalty or memory usage increase.

Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
@ajnavarro ajnavarro merged commit 098c3af into src-d:master Apr 5, 2019
@juanjux
Copy link
Contributor

juanjux commented Apr 5, 2019

 ID      | v0.19.0       | remote:master 
 query00 | 27.146799ms   | 19.213913ms 
 query01 | 13.785561ms   | 12.977023ms 
 query02 | 21.965218ms   | 19.328783ms 
 query03 | 21.14484ms    | 18.02557ms 
 query04 | 22.306052ms   | 19.403494ms 
 query05 | 47.806706ms   | 47.177132ms 
 query06 | 18.567596827s | 18.123985885s 
 query07 | 17.615282ms   | 18.937615ms 
 query08 | 18.233034ms   | 18.130346ms 
 query09 | 17.884928ms   | 17.608783ms 
 query10 | 123.791816ms  | 110.567074ms 
 query11 | 45.499746006s | 45.485031542s 
 query12 | 67.117083ms   | 67.098229ms 
 query13 | 14.240158ms   | 13.681565ms 

Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants