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 path and element resolution when building graph #1068

Merged
merged 39 commits into from
Apr 22, 2022

Conversation

akphi
Copy link
Contributor

@akphi akphi commented Apr 15, 2022

Summary

  • Cleanup section logic
    • Rename sectionAutoImports -> autoImports
    • Separating autoImports and sectionImports in V1_GraphBuilderContext for clearer code.
  • When building the graph, the logic to resolve reference using section index takes a lot of time, we could potentially turn this off when there is not section index, especially for lambdas V1_resolvePathsInRawLambda. We have put control around this behavior to only enable it when processing the main graph.
  • Rename the flag TEMPORARY__keepSectionIndex to TEMPORARY__preserveSectionIndex
  • Remove the flag TEMPORARY__disableRawLambdaResolver as we could use TEMPORARY__preserveSectionIndex instead.
  • RawInstanceValue -> RawPrimitiveInstanceValue
  • Consider removing _$nominalTypeBrand for models. Just basically keep them for plugins
  • Move MappingElementLabel logic out of @finos/legend-graph
  • Move BasicModel.buildPath
  • Move this to AbstractPureGraphManager
new RawLambda(
  [{ _type: 'var', name: 'x' }],
  [
    {
      _type: 'string',
      multiplicity: { lowerBound: 1, upperBound: 1 },
      values: [''],
    },
  ],
),
  • optimize getElement methods in DependencyManager
  • For completeness sake, we should also wrap error around V1_deserializePackageableElement so we properly output error relating to deserialization, also V1_PackageableElementSerializer and V1_PackageableElementTransformer
  • rework Jest config creator to reduce duplicates
  • remove some unnecessary imports from workspaces
  • Allow caching a cache to getOrCreatePackage, a cache map Map<string, Package>, pass the cache in initializeAndIndexElements()
  • Add caching around duplication check when building the graph
  • Refactor BasicModel.getOwnX() to throw, create a separate set BasicModel.getOwnNullableX().
  • Make sure in element builder passes, we only search from currentSubGraph: This should be safe to do since we're already doing the duplication check
  • Fix the problem with observing EmbeddedFlatDataMapping in the same spirit as Bug: fail to observe EmbeddedRelationalInstanceSetImplementation #1086
  • Make parent field in metamodel non-observable and readonly
  • Fix the app jank caused by observe_PureModel/observe_Graph
  • Fix a problem with deleting non-empty packages from the explorer tree
  • Make sure to recursively observe the package chain after creating and renaming element
  • Properly add mobx.action() around methods that create packages like getOrCreatePackage()

How did you test this change?

  • Test(s) added
  • Manual testing (please provide screenshots/recordings)
  • No testing (please provide an explanation)

@changeset-bot
Copy link

changeset-bot bot commented Apr 15, 2022

🦋 Changeset detected

Latest commit: 634b24b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
@finos/legend-graph Major
@finos/legend-studio Major
@finos/legend-application Patch
@finos/legend-art Patch
@finos/legend-dev-utils Patch
@finos/legend-extension-dsl-data-space Patch
@finos/legend-extension-dsl-diagram Patch
@finos/legend-extension-dsl-persistence Patch
@finos/legend-extension-dsl-text Patch
@finos/legend-extension-external-format-json-schema Patch
@finos/legend-extension-external-language-morphir Patch
@finos/legend-extension-external-store-service Patch
@finos/legend-extension-mapping-generation Patch
@finos/legend-graph-extension-collection Patch
@finos/legend-manual-tests Patch
@finos/legend-model-storage Patch
@finos/legend-query Patch
@finos/legend-server-depot Patch
@finos/legend-server-sdlc Patch
@finos/legend-shared Patch
@finos/legend-studio-app Patch
@finos/legend-studio-extension-management-toolkit Patch
@finos/legend-studio-extension-query-builder Patch
@finos/legend-taxonomy Patch
@finos/legend-tracer-extension-zipkin Patch
@finos/eslint-plugin-legend-studio Patch
@finos/legend-query-app Patch
@finos/legend-taxonomy-app Patch
@finos/legend-query-deployment Patch
@finos/legend-studio-deployment Patch
@finos/legend-taxonomy-deployment Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Apr 15, 2022

Codecov Report

Merging #1068 (634b24b) into master (6855e32) will increase coverage by 0.12%.
The diff coverage is 70.20%.

@@            Coverage Diff             @@
##           master    #1068      +/-   ##
==========================================
+ Coverage   42.29%   42.42%   +0.12%     
==========================================
  Files        1045     1046       +1     
  Lines       47069    47141      +72     
  Branches    10726    10745      +19     
==========================================
+ Hits        19910    20000      +90     
+ Misses      27090    27072      -18     
  Partials       69       69              
Impacted Files Coverage Δ
...sl-diagram/src/components/studio/DiagramEditor.tsx 11.28% <0.00%> (+0.03%) ⬆️
...sl-diagram/src/stores/studio/DiagramEditorState.ts 11.76% <0.00%> (ø)
...ure/model/packageableElements/text/DSLText_Text.ts 100.00% <ø> (ø)
...tore/serviceStore/model/ESService_TypeReference.ts 83.33% <ø> (ø)
...e/serviceStore/model/V1_ESService_TypeReference.ts 80.00% <ø> (ø)
...ges/legend-graph-extension-collection/src/index.ts 0.00% <ø> (ø)
...ackages/legend-graph/src/GraphManagerTestUtils.tsx 78.49% <ø> (ø)
packages/legend-graph/src/graph/PureGraphPlugin.ts 100.00% <ø> (ø)
...graph/src/graphManager/AbstractPureGraphManager.ts 100.00% <ø> (ø)
...d-graph/src/graphManager/PureGraphManagerPlugin.ts 100.00% <ø> (ø)
... and 144 more

akphi added 25 commits April 22, 2022 09:32
@MauricioUyaguari MauricioUyaguari merged commit e8ee77d into finos:master Apr 22, 2022
@akphi akphi deleted the baobap branch April 23, 2022 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-present CLA Signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants