-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Gosrc2cpg] download dependencies and caching improvements (#4352)
* Some code refactor and optimisations 1. Removed some unwanted brackets 2. Parallelised downloading of the dependencies and processing them. * Partial changes to add failing unit tests. * Unit tests to cover expected situations to lower the memory footprint * minor changes * Initial download dependency optimisation 1. Record which dependencies are getting used as well as which subpackages are getting used. 2. Only download those dependencies which are directly getting imported or used. * handling for used dependencies 1. Handling for the downloading of dependencies only if those are getting used in the main code. 2. While doing optimisation, came across a bug where if more than one packages with the same name created in the code. Then it was creating package level `TypeDecl` and `NamspaceBlock` only once. Introduced few unit test which covers these use cases as well as made the respective handling for the same. * Fixing one more unit test from first * changes to not cache unwanted imports 1. Made changes to not cache unwanted imports from dependency source code. 2. Made changes to cache only used imports in source code with all the non aliased imports to global cache and aliased ones in the context of file `AstCreator`. 3. Caching only those packages whose package name is different from enclosing folder name inside global cache. * few test corrections as per updated changes * minor updates * Optimisation to cache lamdbda type info Optimisation to cache lamdbda type info * optimisations to store method meta data along with strcut type metata 1. Changed the storage structure to minimize the amount of data being stored for method meta data cache and struct type members type information. 2. Made respective changes to fix all the breaking unit tests. * not caching namespaces having starting letter in small case * Fix for issue related to package TypeDecl 1. While making the optimisations, while processing imports if the main source code package is being imported and processed. In some cases TypeDecl for package level global variables wasn't getting created. 2. Identified the issue and made a fix for the same. * Ignoring few unit tests which needs to be updated with improvements. * review comment fixes
- Loading branch information
1 parent
9b86e80
commit 5106dd3
Showing
16 changed files
with
760 additions
and
216 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
Oops, something went wrong.