-
Notifications
You must be signed in to change notification settings - Fork 738
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
Use a set in SymbolValidationManager::recordExists #4259
Conversation
LexicalOrder() : _result(EQUAL) { } | ||
LexicalOrder(const LexicalOrder &other) : _result(other._result) { } | ||
|
||
static LexicalOrder by(void *a, void *b) { return LexicalOrder().thenBy(a, b); } |
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.
Should the return type be LexicalOrder &
(because of LexicalOrder &thenBy(void *a, void *b)
)?
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.
There's no LexicalOrder
we could reference here that lives past the return, edit: so this returns a copy
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 see; then I guess my question is, why have thenBy
return a reference when passed in void *
but return by value when passed in uintptr_t
?
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, thanks - I didn't mean to copy in thenBy(uintptr_t, uintptr_t)
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.
Fixed
The symbol validation manager uses a linear search along with an equality comparison in order to detect and filter out duplicate records. This commit replaces the equality comparison with an ordering comparison in order to allow the linear scan to be replaced by a set lookup. Signed-off-by: Devin Papineau <devinmp@ca.ibm.com>
This reduces the running time of recordExists from linear to log time. Furthermore, by using a separate data structure here, it's now possible to seed the set with records that should not be generated. Signed-off-by: Devin Papineau <devinmp@ca.ibm.com>
e73bba2
to
d46377b
Compare
Jenkins test sanity xlinux,win,plinux jdk8,jdk11 |
1 similar comment
Jenkins test sanity xlinux,win,plinux jdk8,jdk11 |
Jenkins copyright check |
Jenkins line endings check |
This reduces the running time of
recordExists
from linear to log time. Furthermore, by using a separate data structure here, it's now possible to seed the set with records that should not be generated.An ordering comparison is defined on validation records in order to allow them to be kept in a set.