-
Notifications
You must be signed in to change notification settings - Fork 94
Improve indexing performance #1129
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
Conversation
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.
Benchmarks?
|
src/Utilities/dense_dict.jl
Outdated
end | ||
end | ||
|
||
function inverse_hash(d::DenseDict{K, V, F, I}, el)::K where {K,V,F,I} |
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.
Is this still needed with _index_to_variable
?
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.
Indeed not needed anymore
else | ||
el, i = itr | ||
return d.inverse_hash(el) => d.map[el], i | ||
return d.inverse_hash(el)::K => d.map[el]::V, i |
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.
Are the ::K
and ::V
needed ?
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.
Just tested, Julia does not seem to infer those correctly. Therefore the is a very minor difference a little less than 1%.
I vote for leaving it there, since its not restricting anything.
However, if we really want to avoid that, I can remove.
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.
No if Julia inference is not doing it correctly then leaving it there is what we should do
This iline:
is taking the majority of time for a benchmark with jump-dev/SCS.jl#192 ![]() We might want to set this optimizer_to_index_map to nothing and only create it when needed
|
Did you run with this PR? |
No, I run with master, my point is that this PR is needed |
This reverts commit 9ceded6.
@blegat ready to merge this? |
Improves:
cc @blegat