Repository navigation
perf(index): stop tracking the files being indexed - #687
Merged
Merged
Conversation
AddIndexingFile copies the whole set on every call, which is quadratic in how deeply external files nest. Nothing in the library has read the set since the lookup in find_component_external.go was removed, so stop building it and deprecate the exported helpers.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #687 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 313 313
Lines 39557 39552 -5
=========================================
- Hits 39557 39552 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Thanks! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AddIndexingFilecopies the whole set of files being indexed on every call, so the cost is quadratic in how deeply external files nest, andindexRemoteFilecalls it three times per file. Nothing in the library has read that set since #669 removed the lookup infind_component_external.go, so this stops building it.I kept
AddIndexingFile,GetIndexingFiles,IsFileBeingIndexedandIndexingFilesKeysince they're public, and marked them deprecated. Let me know if you'd rather remove them.BenchmarkRolodex_NestedRemoteFilesindexes a chain of remote files where each one references the next. Median of 6 interleaved runs:Shallow chains barely change.
Anything outside the library that reads
GetIndexingFilesorIsFileBeingIndexedduring indexing will no longer see the library's files.The comment I removed from
rolodex_file_loader.gosaid the set prevents deadlocks on circular references. I don't think that applies since #669, but please check. I added a test that circular remote files finish indexing, which also passes on main.Also added tests for a nested remote chain and for
AddIndexingFile, which would otherwise have no coverage.go test ./...andgo test -race ./...pass withLIBOPENAPI_RUN_NETWORK_TESTS=1, exceptFuzzAppendJSONString/seed#5injson, which fails on main too (Go 1.27.0).