Ruby: Attempt to fix performance of AppCandidate

`DataFlow::MethodNode.getAReturningNode` is expensive to compute.
Instead we look for rack responses which flow to the `SynthReturnNode`.
Each method has only one of these (vs many "returning" nodes) so it is
a lot faster.
I'm not sure yet whether the results are the same.
This commit is contained in:
Harry Maclean
2023-01-23 15:25:52 +13:00
parent 16baea22c0
commit 21ce9b448a

View File

@@ -20,7 +20,7 @@ module Rack {
AppCandidate() {
call = this.getInstanceMethod("call") and
call.getNumberOfParameters() = 1 and
isRackResponse(call.getAReturningNode())
exists(DataFlow::LocalSourceNode resp | isRackResponse(resp) | resp.flowsTo(call.getReturn()))
}
/**