-
Notifications
You must be signed in to change notification settings - Fork 366
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
refractored add references functions to greatly improve xml import speed. #1111
base: master
Are you sure you want to change the base?
refractored add references functions to greatly improve xml import speed. #1111
Conversation
NODE_ID_HAS_PROPERTY = ua.NodeId(ua.ObjectIds.HasProperty) | ||
NODE_ID_NULL = ua.NodeId(ua.ObjectIds.Null) | ||
NODE_ID_HASSUBTYPE = ua.NodeId(ua.ObjectIds.HasSubtype) | ||
NODE_ID_DEFAULT = ua.NodeId() |
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.
Does that help?
I have been considering doing that in main library but i thought someone concluded it does not help much
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.
Yes, from my tests this helps.
asyncua/ua/uaprotocol_auto.py
Outdated
@@ -5906,6 +5906,8 @@ def NodeClass(self): | |||
def NodeClass(self, val): | |||
self.NodeClass_ = val | |||
|
|||
def __hash__(self): | |||
return hash((self.ReferenceTypeId, self.NodeId, self.IsForward)) |
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.
You cannot modify an autogenerated file,
Modify the generating file!
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.
Didn't notice this was generated, sorry, will look into the generator
:ivar NamespaceUri: | ||
:vartype NamespaceUri: String | ||
:ivar ServerIndex: | ||
:vartype ServerIndex: Int |
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.
Why do you remove documentation?
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 doc was redundant with the Args: above, also it does not match the dataclass argument list
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 a special format to generate documentation automatically. better to update it than remove 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.
Will do.
Thought the format above was supported (i think that is google style, also the one I use)
@@ -380,7 +380,7 @@ class NodeIdType(IntEnum): | |||
_NodeIdType = NodeIdType # ugly hack | |||
|
|||
|
|||
@dataclass(frozen=True, eq=False, order=False) | |||
@dataclass(slots=True, frozen=True, eq=False, order=False) |
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 remember we considered using slot instead of our custon frozen thing. We had some reasons for not using it...not remembering what...
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.
Slots help, but it was not the biggest improvement. Will revert this
I tried to run the update_ua_nodeset.py and I keep getting errors in multiple places.
Other notes: the generator script assumes that the script is running with cwd on the same dir of the update_ua_nodeset.py, maybe this should be fixed as I noticed that later. In the end I quit trying to run it :( |
This is caused by visual studio code. There is no workaround only closing visual studio code.
Last time i tried it work. Will try soon.
Noticed it last time too. But just reverted to the current used nodeset UA1.05.01. The easiest way currently is to check out the nodeset your self via git. Then execute all the scripts:
Also be carefull if you make errors generating schemas you need to revert the changes via git. Because some generating scripts use generated code. |
With this changes I was able to import a set of XMLs in about 35s in my machine. Without this changes the same set of inf models won't finish importing even after 5 minutes!