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

WI #1301 Optimize symbol table #1308

Merged
merged 11 commits into from
Mar 15, 2019

Conversation

osmedile
Copy link
Contributor

Issues : #1294 #1301 #1302 #1114
Here's a first set of optimization mainly focused on SymbolTable and one commit about TypeCobolLinker.

You can look at each commit separatly to understand the optimization done.

Gain obtained on each performance test:

Note : One of the major optimization is only valid for unused variables.
So depending on the source file, you won't get the same result.

Test Gain
Part1_FullParsing_Cobol85_NoRedefines 6%
Part1_FullParsing_TC_BigTypesNoProcedure 34%
Part1_FullParsing_TC_BigTypesWithProcedure 18%
Part1_FullParsing_TC_GlobalStorage 12%
Part1_Incremental_Cobol85_NoRedefines 40%
Part1_Incremental_TC_BigTypesNoProcedure 71%
Part1_Incremental_TC_BigTypesWithProcedure 46%
Part1_Incremental_TC_GlobaStorage 45%
Part2_FullParsing_TC_UseALotOfTypes_001Time 22%
Part2_FullParsing_TC_UseALotOfTypes_100Times 42%
Part2_FullParsing_TC_UseALotOfTypes_WithProc_100Times 57%
Part2_Incremental_TC_UseALotOfTypes_001Time 57%
Part2_Incremental_TC_UseALotOfTypes_100Times 51%
Part2_Incremental_TC_UseALotOfTypes_WithProc_100Times 87%
Part3_FullParsing_Cobol85_DeepVariables 22%
Part3_FullParsing_TC_DeepTypes 51%
Part3_Incremental_Cobol85_DeepVariables 57%
Part3_Incremental_TC_DeepTypes 73%

osmedile added 11 commits March 10, 2019 22:02
Search for paragraphs/sections are limited to current SymbolTable.
Search for variables are limited to scope GlobalStorage.
Search for functions/types in all scopes.
Put Count of IEnumerable on a temporary var to avoid multiple Count
…e typedef

There are 2 separate method to seach variables:
 - Variable outside typedef with a simple algo
 - Variable inside typedef with a complex algo

Code separation make it easier to understand and increase performance
for code without typedef.
GetType is intented fot find a TypeDefinition.
TypeDefinition is from Cobol2002 or above so there is no need to
search for a TypeDefinition if the dataType is Cobol85.
Speed up lookup of variables inside typedef.
Rewrite algorithm to avoid multiple enumeration of list
… result list passed as arguments

This avoid to create multiple list especially when there is no
symbol found in the current SymbolTable
…pedef

Do not search for type reference for DataDefinition outside
typedef.
…ller/unnamed symbol

Check node name instead of QualifiedName.
This improve performance for all unused variable.
For used variables, QualifiedName can be still be used
elsewhere in the code.
@smedilol smedilol merged commit c9389ca into TypeCobolTeam:develop Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Performance User Visible Visible by the end user. Useful to priorize issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants