Skip to content

Optimize calls to get the Users for a a points-to vertex.#93

Merged
pdschubert merged 1 commit intosecure-software-engineering:masterfrom
ddiepo-pjr:OptimizePtUsers
Feb 17, 2020
Merged

Optimize calls to get the Users for a a points-to vertex.#93
pdschubert merged 1 commit intosecure-software-engineering:masterfrom
ddiepo-pjr:OptimizePtUsers

Conversation

@ddiepo-pjr
Copy link
Copy Markdown
Contributor

The call to Value->users() is quite expensive. Because the result
should not change between executions, we can cache the results for each
Vertex of the points-to graph. This has a significant performance
improvement.

Changing the graph's backing data structure edge type to use a vector
instead of a set also improves performance.

This change also modifies the n^2 loop to be n^2/2 as described in the
comments -- the inner loop was previously starting at the beginning of
the map instead of at the next item in the map, and we can avoid looking
up in the map by using the appropriate iterators. These changes did not
significantly impact performance, however the resulting code is more
concise.

The call to Value->users() is quite expensive.  Because the result
should not change between executions, we can cache the results for each
Vertex of the points-to graph.  This has a significant performance
improvement.

This change also modifies the n^2 loop to be n^2/2 as described in the
comments -- the inner loop was previously starting at the beginning of
the map instead of at the next item in the map, and we can avoid looking
up in the map by using the appropriate iterators.  These changes did not
significantly impact performance, however the resulting code is more
concise.
@pdschubert pdschubert merged commit 4727c83 into secure-software-engineering:master Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants