-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perf: Traverse commit history instead of reading the packfile
To avoid show orphan commits and improve performance on commits table, instead of read all the objects from each repository and discard commits, we can execute from go-git a git log --all command and traverse commit history, avoiding read a lot of data from disk. Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>
- Loading branch information
Showing
13 changed files
with
117 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,14 +101,14 @@ func TestCommitsParents(t *testing.T) { | |
}{ | ||
{ | ||
name: "test commits parents 1", | ||
hash: "e8d3ffab552895c19b9fcf7aa264d277cde33881", | ||
hash: "6ecf0ef2c2dffb796033e5a02219af86ec6584e5", | ||
parents: []string{ | ||
"918c48b83bd081e863dbe1b80f8998f058cd8294", | ||
}, | ||
}, | ||
{ | ||
name: "test commits parents 2", | ||
hash: "6ecf0ef2c2dffb796033e5a02219af86ec6584e5", | ||
hash: "e8d3ffab552895c19b9fcf7aa264d277cde33881", | ||
parents: []string{ | ||
"918c48b83bd081e863dbe1b80f8998f058cd8294", | ||
}, | ||
|
@@ -137,30 +137,30 @@ func TestCommitsParents(t *testing.T) { | |
}, | ||
{ | ||
name: "test commits parents 6", | ||
hash: "a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69", | ||
hash: "35e85108805c84807bc66a02d91535e1e24b38b9", | ||
parents: []string{ | ||
"b029517f6300c2da0f4b651b8642506cd6aaf45d", | ||
"b8e471f58bcbca63b07bda20e428190409c2db47", | ||
}, | ||
}, | ||
{ | ||
name: "test commits parents 7", | ||
hash: "b8e471f58bcbca63b07bda20e428190409c2db47", | ||
parents: []string{ | ||
"b029517f6300c2da0f4b651b8642506cd6aaf45d", | ||
}, | ||
name: "test commits parents 7", | ||
hash: "b029517f6300c2da0f4b651b8642506cd6aaf45d", | ||
parents: []string{}, | ||
}, | ||
{ | ||
name: "test commits parents 8", | ||
hash: "35e85108805c84807bc66a02d91535e1e24b38b9", | ||
hash: "a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69", | ||
parents: []string{ | ||
"b029517f6300c2da0f4b651b8642506cd6aaf45d", | ||
"b8e471f58bcbca63b07bda20e428190409c2db47", | ||
}, | ||
}, | ||
{ | ||
name: "test commits parents 9", | ||
hash: "b029517f6300c2da0f4b651b8642506cd6aaf45d", | ||
parents: []string{}, | ||
name: "test commits parents 9", | ||
hash: "b8e471f58bcbca63b07bda20e428190409c2db47", | ||
parents: []string{ | ||
"b029517f6300c2da0f4b651b8642506cd6aaf45d", | ||
}, | ||
}, | ||
} | ||
|
||
|
@@ -188,65 +188,65 @@ func TestCommitsIndexKeyValueIter(t *testing.T) { | |
assertEncodeKey(t, &packOffsetIndexKey{ | ||
Repository: path, | ||
Packfile: "323a4b6b5de684f9966953a043bc800154e5dbfa", | ||
Offset: 682, | ||
Offset: 186, | ||
}), | ||
[]interface{}{ | ||
"1669dce138d9b841a518c64b10914d88f5e488ea", | ||
"6ecf0ef2c2dffb796033e5a02219af86ec6584e5", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
assertEncodeKey(t, &packOffsetIndexKey{ | ||
Repository: path, | ||
Packfile: "323a4b6b5de684f9966953a043bc800154e5dbfa", | ||
Offset: 1292, | ||
Offset: 12, | ||
}), | ||
[]interface{}{ | ||
"35e85108805c84807bc66a02d91535e1e24b38b9", | ||
"e8d3ffab552895c19b9fcf7aa264d277cde33881", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
assertEncodeKey(t, &packOffsetIndexKey{ | ||
Repository: path, | ||
Packfile: "323a4b6b5de684f9966953a043bc800154e5dbfa", | ||
Offset: 186, | ||
Offset: 353, | ||
}), | ||
[]interface{}{ | ||
"6ecf0ef2c2dffb796033e5a02219af86ec6584e5", | ||
"918c48b83bd081e863dbe1b80f8998f058cd8294", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
assertEncodeKey(t, &packOffsetIndexKey{ | ||
Repository: path, | ||
Packfile: "323a4b6b5de684f9966953a043bc800154e5dbfa", | ||
Offset: 353, | ||
Offset: 516, | ||
}), | ||
[]interface{}{ | ||
"918c48b83bd081e863dbe1b80f8998f058cd8294", | ||
"af2d6a6954d532f8ffb47615169c8fdf9d383a1a", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
assertEncodeKey(t, &packOffsetIndexKey{ | ||
Repository: path, | ||
Packfile: "323a4b6b5de684f9966953a043bc800154e5dbfa", | ||
Offset: 905, | ||
Offset: 682, | ||
}), | ||
[]interface{}{ | ||
"a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69", | ||
"1669dce138d9b841a518c64b10914d88f5e488ea", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
assertEncodeKey(t, &packOffsetIndexKey{ | ||
Repository: path, | ||
Packfile: "323a4b6b5de684f9966953a043bc800154e5dbfa", | ||
Offset: 516, | ||
Offset: 1292, | ||
}), | ||
[]interface{}{ | ||
"af2d6a6954d532f8ffb47615169c8fdf9d383a1a", | ||
"35e85108805c84807bc66a02d91535e1e24b38b9", | ||
"[email protected]", | ||
}, | ||
}, | ||
|
@@ -265,22 +265,22 @@ func TestCommitsIndexKeyValueIter(t *testing.T) { | |
assertEncodeKey(t, &packOffsetIndexKey{ | ||
Repository: path, | ||
Packfile: "323a4b6b5de684f9966953a043bc800154e5dbfa", | ||
Offset: 1130, | ||
Offset: 905, | ||
}), | ||
[]interface{}{ | ||
"b8e471f58bcbca63b07bda20e428190409c2db47", | ||
"[email protected]", | ||
"a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69", | ||
"[email protected]", | ||
}, | ||
}, | ||
{ | ||
assertEncodeKey(t, &packOffsetIndexKey{ | ||
Repository: path, | ||
Packfile: "323a4b6b5de684f9966953a043bc800154e5dbfa", | ||
Offset: 12, | ||
Offset: 1130, | ||
}), | ||
[]interface{}{ | ||
"e8d3ffab552895c19b9fcf7aa264d277cde33881", | ||
"[email protected]", | ||
"b8e471f58bcbca63b07bda20e428190409c2db47", | ||
"[email protected]", | ||
}, | ||
}, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.