JS: add isRelevant(succ) to flowStep predicate #3070
Merged
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.
While evaluating #3019 I found a weird performance regression in the
sqlteaching
benchmark that was most notable with thejs/insecure-randomness
query.It ran about 3 times slower than on master.
Turns out that all I needed to trigger the performance regression was to add 3 edges to the exploratory flow (the
exploratoryFlowStep
predicate), corresponding to 3 calls toarray.filter()
.Adding those 3 edges caused the exploratory flow to find ~200.000 data-flow nodes, instead of 44, which caused the query to run 3 times slower.
I only needed to add the edges in the exploratory flow to trigger the regression, and nowhere else.
But most of the extra time was not spend in the exploratory flow, so it seemed there was room for improvement.
With this one line change most, but not all, of the performance was regained.
(Performance went from about 245 seconds to about 95 seconds)
And the change seems to improve performance across all benchmarks (big evaluation pending).
Here are two small evaluations on some benchmarks:
https://git.semmle.com/erik/dist-compare-reports/tree/profiling-js-max.northeurope.cloudapp.azure.com_1584361183161
https://git.semmle.com/erik/dist-compare-reports/tree/profiling-js-asger.northeurope.cloudapp.azure.com_1584356931002