Avoid slow HTML parsing in hierarchy sort function#1383
Merged
Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
kinow
approved these changes
Oct 26, 2022
Codecov ReportBase: 71.17% // Head: 71.17% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #1383 +/- ##
=========================================
Coverage 71.17% 71.17%
Complexity 1650 1650
=========================================
Files 32 32
Lines 3788 3788
=========================================
Hits 2696 2696
Misses 1092 1092 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Member
Author
|
Adjusted the |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Reasons for creating this PR
The rendering of the concept hierarchy was very slow in some cases, see #1377. The reason is that HTML code is being parsed within the
nodeLabelSortKeyfunction and this can be very slow when there are many concepts shown in the hierarchy. This PR changes the waynodeLabelSortKeyis implemented to avoid the slow HTML parsing, thus making the hierarchy show up a lot faster.I couldn't find an easy way to benchmark this but the speedup is quite dramatic for instance in the case of the YSO concept "haircutting" that was used as an example in #1377.
Link to relevant issue(s), if any
Description of the changes in this PR
label(similar to e.g.uriandnotation)Known problems or uncertainties in this PR
This PR changes the functions
createConceptObject,createObjectsFromChildren,vocabRootandcreateObjectsFromNarrowerswhich are also overridden in thefooter.incfile which is part of the Finto customizations. If you have installed the customizations as they are currently written, this code will not work properly because thelabelattribute will be missing from nodes. The changes need to be applied tofooter.incas well. I will do that shortly.Checklist
.sr-onlyclass, color contrast)