-
Notifications
You must be signed in to change notification settings - Fork 635
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
Node Search performance improvements #12056
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
06d0ad3
first pass
pinzart ec2fd27
Update SearchDictionary.cs
pinzart 4ad7d64
Update SearchDictionary.cs
pinzart a4a0298
Update SearchDictionary.cs
pinzart ca08dd7
update
pinzart 6344b71
improvements
pinzart 6f1341d
Merge branch 'master' into simplify_search
pinzart 3c4eca2
add unit performance unit test
pinzart cc1db45
test seachCommand invoke count
pinzart 7124644
Create searchtags.log
pinzart ebe06b4
update
pinzart 7be230c
scramble data
pinzart ab05505
Update SearchDictionaryTest.cs
pinzart ce3999d
Merge branch 'master' into simplify_search
pinzart 3216447
add hidden option
pinzart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Diagnostics; | ||
using System.Configuration; | ||
using System.Reflection; | ||
|
||
namespace Dynamo.Search | ||
{ | ||
|
@@ -15,6 +17,22 @@ public class SearchDictionary<V> | |
private ILogger logger; | ||
private static int LIMIT_SEARCH_TAG_SIZE = 300; | ||
|
||
static SearchDictionary() | ||
{ | ||
try | ||
{ | ||
// Look up search tag limit in the assembly configuration | ||
var assemblyConfig = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
if (assemblyConfig != null) | ||
{ | ||
var searchTagSizeLimit = assemblyConfig.AppSettings.Settings["searchTagSizeLimit"]; | ||
if (searchTagSizeLimit != null && int.TryParse(searchTagSizeLimit.Value, out int value)) | ||
LIMIT_SEARCH_TAG_SIZE = value; | ||
} | ||
} | ||
catch { } | ||
} | ||
|
||
/// <summary> | ||
/// Construct a SearchDictionary object | ||
/// </summary> | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we all agree that 300 characters is good enough ?
Should we increase ?
Looking through the search tags we got from Jostein, I found the following:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ALso this limit will be used in the Package Search window as well..(using package descriptions)
We could use another limit for Package Search ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @mjkkirschner @aparajit-pratap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine by me but I'm still confused - these search tags from Jostein look like node descriptions. I'm curious if the entire description is used as a search tag, then what's the benefit of the search tags included in the
<search></search>
XML?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aparajit-pratap it's to inject extra search terms without adding them to the description.
So I can add
box
to the search terms for Cuboid - without needing to addbox
to the description.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinzart90 what do you think about making this a hidden preference? I know it's more work, and kind of a pain, but it let's users tweak it if they run into trouble.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjkkirschner I added a new assembly config for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, sorry @pinzart90 - I was not clear, by hidden preference -I just meant a preference in the dynamosettings.xml with no analog in the UI to control it. This is fine as well, users can still modify this if we want them to test something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjkkirschner if you think there is good enough reason to move to Preferences, then I can do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a good idea to move it to the preference settings file so we have all preferences in one place. That is usually the one file where all such user preferences go.