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

Optimize SymbolTable #1301

Closed
smedilol opened this issue Mar 8, 2019 · 0 comments
Closed

Optimize SymbolTable #1301

smedilol opened this issue Mar 8, 2019 · 0 comments
Assignees
Labels
Enhancement Performance User Visible Visible by the end user. Useful to priorize issue

Comments

@smedilol
Copy link
Contributor

smedilol commented Mar 8, 2019

CHILD OF #1294

Optimize SymbolTable:

  • Variable and paragraph/section are search in all scopes of the SymbolTable even if a scope cannot contains these symbols
  • Some Enumeration are iterated multiple times
  • The algorithm to resolve variable outside typedef is shared with the one with variable inside typedef
    • As variable inside typedef is more complex, we should separate the 2
@smedilol smedilol added this to the v1.3.1 milestone Mar 8, 2019
@smedilol smedilol self-assigned this Mar 8, 2019
@smedilol smedilol mentioned this issue Mar 8, 2019
5 tasks
@smedilol smedilol added the User Visible Visible by the end user. Useful to priorize issue label Mar 8, 2019
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
Search for paragraph/sections are limited to current SymbolTable.
Search for variables are limited to scope GlobalStorage.
Search for functions/type in all scopes
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
…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.
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
Search for paragraphs/sections are limited to current SymbolTable.
Search for variables are limited to scope GlobalStorage.
Search for functions/types in all scopes.
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
…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.
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
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.
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
Speed up lookup of variables inside typedef.
Rewrite algorithm to avoid multiple enumeration of list
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
… result list passed as arguments

This avoid to create multiple list especially when there is no
symbol found in the current SymbolTable
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 10, 2019
…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 added a commit that referenced this issue Mar 15, 2019
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 17, 2019
…ations

Public Types cannot be present in scope under Declarations so don't need
to search for data under public type in the scope below.

Small optimization in SymbolTable: reuse same list for intermediate result
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 17, 2019
… if needed

When searching variable in SymbolTable, fully qualified name is only
used when:
- Display errors when the searched SymbolReference is ambiguous
- Codegen: the full qualified name is use to create a unique hash for
index

For variable outside typedef call property VisualQualifiedName only if
needed.
For variable under typedef replace full qualified name of variable
with a more lightweight system (DataDefinitionPath).

DataDefinitionPath only store key DataDefinition.
These key DataDefinition can be used to reconstruct the full
qualified path of a variable under a typedef.
osmedile added a commit to osmedile/TypeCobol that referenced this issue Mar 17, 2019
Instead of getting a list with all DataDefinition children that match the searched DataDefinition name then search in this list if the searched DataDefinition is present, directly compare the parentTypeDefinition.

The only use case is to resolve DEPENDING ON inside typedef so
performance gain should not be visible in real situation.
smedilol added a commit that referenced this issue Mar 29, 2019
@maxime645 maxime645 mentioned this issue May 10, 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

No branches or pull requests

1 participant