Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Comments

Improve the CRUD performance of LU sections#901

Merged
Danieladu merged 20 commits intomasterfrom
hond/luparser-perf
Jul 18, 2020
Merged

Improve the CRUD performance of LU sections#901
Danieladu merged 20 commits intomasterfrom
hond/luparser-perf

Conversation

@Danieladu
Copy link
Contributor

@Danieladu Danieladu commented Jul 16, 2020

Fixes: #888
Improve the performance for adding/updating/deleting/inserting section into LUResource.

What this pr did:

  1. Replace parseTree with "range" in section
  2. Only parse corresponding lu content to avoid the whole file parsing
  3. Adjust section and error range

what will do

  • Pass all tests
  • Provide performance-enhancing data reports

what should be discussed

Currently, LU has no static checker. So, if someone updates a section, the diagnostic of the original section should be removed.
The issue is, it is hard to locate the original errors, for many of them do not contain the range info.
Welcome to propose a solution.

performance improvement

  Before After
Parse whole file 600ms 600ms
CRUD time 400ms(With builtin cache) 5ms

@boydc2014 boydc2014 marked this pull request as ready for review July 17, 2020 01:06
@boydc2014 boydc2014 requested a review from munozemilio as a code owner July 17, 2020 01:06
@Danieladu Danieladu requested a review from feich-ms July 17, 2020 02:42
@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2020

Codecov Report

Merging #901 into master will increase coverage by 0.20%.
The diff coverage is 92.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #901      +/-   ##
==========================================
+ Coverage   57.25%   57.45%   +0.20%     
==========================================
  Files         218      220       +2     
  Lines       16237    16269      +32     
  Branches     2251     2241      -10     
==========================================
+ Hits         9296     9347      +51     
+ Misses       6362     6352      -10     
+ Partials      579      570       -9     
Impacted Files Coverage Δ
packages/lu/src/parser/lufile/baseSection.js 58.33% <58.33%> (ø)
packages/lu/src/parser/lufile/sectionOperator.js 86.84% <88.05%> (-3.41%) ⬇️
packages/lu/src/parser/lufile/diagnostic.js 100.00% <100.00%> (ø)
packages/lu/src/parser/lufile/entitySection.js 97.50% <100.00%> (+0.35%) ⬆️
packages/lu/src/parser/lufile/importSection.js 100.00% <100.00%> (ø)
packages/lu/src/parser/lufile/luParser.js 91.39% <100.00%> (-0.13%) ⬇️
packages/lu/src/parser/lufile/luResource.js 100.00% <100.00%> (ø)
packages/lu/src/parser/lufile/modelInfoSection.js 100.00% <100.00%> (ø)
...ckages/lu/src/parser/lufile/nestedIntentSection.js 94.44% <100.00%> (+1.11%) ⬆️
packages/lu/src/parser/lufile/newEntitySection.js 92.45% <100.00%> (+0.96%) ⬆️
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9de7f4c...70df34b. Read the comment docs.

@feich-ms
Copy link
Contributor

@lei9444 please verify the functionality and efficiency of this improvments in composer side.

@Danieladu Danieladu merged commit 7816875 into master Jul 18, 2020
@Danieladu Danieladu deleted the hond/luparser-perf branch July 18, 2020 23:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the Lu intents CRUD performance

3 participants