-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: We want to ensure this is always "out to in" when constructing SNames. .. at least for very long SNames. For short ones, not sure. something recently changed to trigger the cost of this to blow up as it enumerates SNames in the opposite direction. Fix it by specifying an order and adding some perf tests. Before: would be a timeout: ``` fbsource.fbcode.python> search.python.QueryToScopeCase { ["gen_ai","genie_projects","offline_inference", "app","llama2","config"], false, _ } { "id": 1419228269, "key": { "query": [ "gen_ai", "genie_projects", "offline_inference", "app", "llama2", "config" ], "insensitive": false, ... 1 results, 13 facts, 7464.64ms, 24105032 bytes, 12056 compiled bytes Facts searched: python.SName.4 : 142544 python.SearchModuleByName.4 : 5 python.Name.4 : 1 python.SearchClassByName.4 : 1 ``` After: ``` fbsource.fbcode.python> search.python.QueryToScopeCase { ["gen_ai","genie_projects","offline_inference", "app","llama2","config"], false, _ } { "id": 1419086769, "key": { "query": [ "gen_ai", "genie_projects", "offline_inference", "app", "llama2", "config" ], "scopeName": { ... 1 results, 13 facts, 14.80ms, 28758344 bytes, 14170 compiled bytes Facts searched: python.SName.4 : 313 python.Name.4 : 6 python.SearchModuleByName.4 : 5 python.SearchClassByName.4 : 1 ``` I think this lurking issue might also explain why there was only minor movement in python scope search p99, whereas name search dropped dramatically when the name tables switched over; {F1973781970} Reviewed By: phlalx Differential Revision: D67120662 fbshipit-source-id: 3445dbf55d7d86dc8a82b25ade37b4e01edbcd25
- Loading branch information
1 parent
1a4844f
commit bfef488
Showing
113 changed files
with
2,152 additions
and
91 deletions.
There are no files selected for viewing
573 changes: 573 additions & 0 deletions
573
glean/lang/codemarkup/tests/python/cases/search/fileentities.out
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
glean/lang/codemarkup/tests/python/cases/search/fileentities.perf
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@generated": null, | ||
"facts_searched": { "python.DeclarationsByFile.4": 31 }, | ||
"full_scans": [ "python.DeclarationsByFile.4" ] | ||
} |
3 changes: 3 additions & 0 deletions
3
glean/lang/codemarkup/tests/python/cases/search/fileentities.query
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
query: codemarkup.FileEntityLocations _ | ||
perf: true | ||
transform: [normord, []] |
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
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
1 change: 1 addition & 0 deletions
1
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9.out
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
[ "@generated" ] |
1 change: 1 addition & 0 deletions
1
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9.perf
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "@generated": null, "facts_searched": { }, "full_scans": [ ] } |
3 changes: 3 additions & 0 deletions
3
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9.query
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
query: codemarkup.search.SearchByScope { name = "meth_9", scope = ["some","foo","In1","In2","In3","In4","In5","In6","In7","In8","In9"], searchcase = Sensitive, language = Python } | ||
perf: true | ||
transform: [normord, []] |
41 changes: 41 additions & 0 deletions
41
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_a.out
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[ | ||
"@generated", | ||
{ | ||
"key": { | ||
"entity": { | ||
"python": { | ||
"decl": { | ||
"func": { | ||
"key": { | ||
"name": { | ||
"key": "some.foo.In1.In2.In3.In4.In5.In6.In7.In8.In9.meth_9" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"kind": 7, | ||
"language": 4, | ||
"location": { | ||
"file": { "key": "some/foo.py" }, | ||
"location": { "span": { "length": 69, "start": 629 } }, | ||
"name": "some.foo.In1.In2.In3.In4.In5.In6.In7.In8.In9.meth_9" | ||
}, | ||
"name": "meth_9", | ||
"scope": [ | ||
"In1", | ||
"In2", | ||
"In3", | ||
"In4", | ||
"In5", | ||
"In6", | ||
"In7", | ||
"In8", | ||
"In9", | ||
"foo" | ||
], | ||
"searchcase": 0 | ||
} | ||
} | ||
] |
13 changes: 13 additions & 0 deletions
13
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_a.perf
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"@generated": null, | ||
"facts_searched": { | ||
"python.DeclarationDefinition.4": 1, | ||
"python.DeclarationLocation.4": 1, | ||
"python.Name.4": 10, | ||
"python.SName.4": 12, | ||
"python.SearchClassByName.4": 9, | ||
"python.SearchMethodByName.4": 1, | ||
"python.SearchModuleByName.4": 1 | ||
}, | ||
"full_scans": [ ] | ||
} |
3 changes: 3 additions & 0 deletions
3
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_a.query
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
query: codemarkup.search.SearchByScope { name = "meth_9", scope = ["foo","In1","In2","In3","In4","In5","In6","In7","In8","In9"], searchcase = Sensitive, language = Python } | ||
perf: true | ||
transform: [normord, []] |
40 changes: 40 additions & 0 deletions
40
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_a_class_kind.out
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[ | ||
"@generated", | ||
{ | ||
"key": { | ||
"entity": { | ||
"python": { | ||
"decl": { | ||
"cls": { | ||
"key": { | ||
"name": { | ||
"key": "some.foo.In1.In2.In3.In4.In5.In6.In7.In8.In9" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"kind": 6, | ||
"language": 4, | ||
"location": { | ||
"file": { "key": "some/foo.py" }, | ||
"location": { "span": { "length": 116, "start": 582 } }, | ||
"name": "some.foo.In1.In2.In3.In4.In5.In6.In7.In8.In9" | ||
}, | ||
"name": "In9", | ||
"scope": [ | ||
"In1", | ||
"In2", | ||
"In3", | ||
"In4", | ||
"In5", | ||
"In6", | ||
"In7", | ||
"In8", | ||
"foo" | ||
], | ||
"searchcase": 0 | ||
} | ||
} | ||
] |
12 changes: 12 additions & 0 deletions
12
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_a_class_kind.perf
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"@generated": null, | ||
"facts_searched": { | ||
"python.DeclarationDefinition.4": 1, | ||
"python.DeclarationLocation.4": 1, | ||
"python.Name.4": 9, | ||
"python.SName.4": 11, | ||
"python.SearchClassByName.4": 9, | ||
"python.SearchModuleByName.4": 1 | ||
}, | ||
"full_scans": [ ] | ||
} |
3 changes: 3 additions & 0 deletions
3
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_a_class_kind.query
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
query: codemarkup.search.SearchByScope { name = "In9", scope = ["foo","In1","In2","In3","In4","In5","In6","In7","In8"], searchcase = Sensitive, language = Python, kind = { just = Class_ } } | ||
perf: true | ||
transform: [normord, []] |
41 changes: 41 additions & 0 deletions
41
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_a_kind.out
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[ | ||
"@generated", | ||
{ | ||
"key": { | ||
"entity": { | ||
"python": { | ||
"decl": { | ||
"func": { | ||
"key": { | ||
"name": { | ||
"key": "some.foo.In1.In2.In3.In4.In5.In6.In7.In8.In9.meth_9" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"kind": 7, | ||
"language": 4, | ||
"location": { | ||
"file": { "key": "some/foo.py" }, | ||
"location": { "span": { "length": 69, "start": 629 } }, | ||
"name": "some.foo.In1.In2.In3.In4.In5.In6.In7.In8.In9.meth_9" | ||
}, | ||
"name": "meth_9", | ||
"scope": [ | ||
"In1", | ||
"In2", | ||
"In3", | ||
"In4", | ||
"In5", | ||
"In6", | ||
"In7", | ||
"In8", | ||
"In9", | ||
"foo" | ||
], | ||
"searchcase": 0 | ||
} | ||
} | ||
] |
13 changes: 13 additions & 0 deletions
13
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_a_kind.perf
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"@generated": null, | ||
"facts_searched": { | ||
"python.DeclarationDefinition.4": 1, | ||
"python.DeclarationLocation.4": 1, | ||
"python.Name.4": 10, | ||
"python.SName.4": 12, | ||
"python.SearchClassByName.4": 9, | ||
"python.SearchMethodByName.4": 1, | ||
"python.SearchModuleByName.4": 1 | ||
}, | ||
"full_scans": [ ] | ||
} |
3 changes: 3 additions & 0 deletions
3
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_a_kind.query
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
query: codemarkup.search.SearchByScope { name = "meth_9", scope = ["foo","In1","In2","In3","In4","In5","In6","In7","In8","In9"], searchcase = Sensitive, language = Python, kind = { just = Method } } | ||
perf: true | ||
transform: [normord, []] |
40 changes: 40 additions & 0 deletions
40
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_b.out
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[ | ||
"@generated", | ||
{ | ||
"key": { | ||
"entity": { | ||
"python": { | ||
"decl": { | ||
"func": { | ||
"key": { | ||
"name": { | ||
"key": "some.foo.In1.In2.In3.In4.In5.In6.In7.In8.In9.meth_9" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"kind": 7, | ||
"language": 4, | ||
"location": { | ||
"file": { "key": "some/foo.py" }, | ||
"location": { "span": { "length": 69, "start": 629 } }, | ||
"name": "some.foo.In1.In2.In3.In4.In5.In6.In7.In8.In9.meth_9" | ||
}, | ||
"name": "meth_9", | ||
"scope": [ | ||
"In1", | ||
"In2", | ||
"In3", | ||
"In4", | ||
"In5", | ||
"In6", | ||
"In7", | ||
"In8", | ||
"In9" | ||
], | ||
"searchcase": 0 | ||
} | ||
} | ||
] |
12 changes: 12 additions & 0 deletions
12
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_b.perf
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"@generated": null, | ||
"facts_searched": { | ||
"python.DeclarationDefinition.4": 1, | ||
"python.DeclarationLocation.4": 1, | ||
"python.Name.4": 9, | ||
"python.SName.4": 9, | ||
"python.SearchClassByName.4": 9, | ||
"python.SearchMethodByName.4": 1 | ||
}, | ||
"full_scans": [ ] | ||
} |
3 changes: 3 additions & 0 deletions
3
glean/lang/codemarkup/tests/python/cases/search/search_scope_long_9_b.query
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
query: codemarkup.search.SearchByScope { name = "meth_9", scope = ["In1","In2","In3","In4","In5","In6","In7","In8","In9"], searchcase = Sensitive, language = Python } | ||
perf: true | ||
transform: [normord, []] |
Oops, something went wrong.