-
Notifications
You must be signed in to change notification settings - Fork 29
Implementation of several scheduling methods to improve the performance of static analyses #263
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
base: develop
Are you sure you want to change the base?
Conversation
…se can run without exception
This reverts commit 0d3ba57.
…erTest.scala eingepflegt, erste Anfänge Purity anzupassen
# Conflicts: # DEVELOPING_OPAL/tools/src/main/scala/org/opalj/support/info/Immutability.scala # OPAL/si/src/main/scala/org/opalj/fpcf/seq/PKESequentialPropertyStore.scala
…debugging purposes ONLY!
…es at once. Old immutability with manual batching is also included in the folder
…asurement # Conflicts: # OPAL/tac/src/main/scala/org/opalj/tac/fpcf/analyses/cg/DoPrivilegedCGAnalysis.scala
…r the handleNewCallers method in the FieldLocalityAnalysis.scala
…ss to be able to set the Config in the Runner/Analysis. Implementation of new schedulers becomes easier.
@@ -4,7 +4,7 @@ org.opalj { | |||
// to support the debugging of analyses developed using the property store. | |||
// I.e., debug performs a wide range of additionaly checks to identify errors as | |||
// early as possible. | |||
fpcf.PropertyStore.Debug = false | |||
fpcf.PropertyStore.Debug = true |
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.
Please revert this change
if (cleanUpSubPhase.isEmpty) { | ||
finalizationOrder.toArray | ||
(propertyKindsComputedInThisPhase -- finalizationOrder.flatten.toSet) | ||
this.subPhaseFinalizationOrder = (if (cleanUpSubPhase.isEmpty) { |
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.
This is not pretty. Can it be cleaned up? At least it should be documented what it's doing.
val scenario = AnalysisScenario(Set(eager1, eager3, eager4, eager5, eager6, eager2, lazy1, lazy2, lazy3, transformer1, triggered1, triggered2, triggered3), ps) | ||
val schedule = scenario.computeSchedule(ps) | ||
|
||
print(schedule.batches) |
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.
This isn't a test if it just prints stuff
@@ -44,6 +43,114 @@ class PropertyComputationsSchedulerTest extends AnyFunSpec with Matchers with Be | |||
derivesEagerly = Set(PropertyBounds.lub(pks(1))) | |||
) | |||
|
|||
def analysis1IsScheduledBeforeOrAtTheSameBatchAsAnalysis2( |
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.
What are these methods for? They don't seem to be used
/** | ||
* This ImmutabilityRunner has been adapted for the scheduling strategies. This means that all analyses are transferred to one scheduler, | ||
* whereby the call graph is transferred to the scheduler with the other analyses in “dependencies”. | ||
* The original immutability analysis is the "Immutability.scala". |
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.
Please merge into the original runner or remove, we can't maintain two almost identical ones.
counter = counter + 1 | ||
} | ||
|
||
val transformedGraph = preparedGraph.map { case (node, deps) => |
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.
Name is not descriptive
sortedNodes = sortedNodes :+ node | ||
} | ||
|
||
} |
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.
Insert blank line after method definition
} | ||
|
||
sortedNodes | ||
} |
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.
Insert blank line after method definition
def mergeIndependentBatches( | ||
tfMap: Map[Int, List[Int]], | ||
ct: Int, | ||
graph: Map[Int, List[Int]] |
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.
Names are not descriptive
graph: Map[Int, List[Int]] | ||
): Map[Int, List[Int]] = { | ||
|
||
var allUses: Set[Int] = Set.empty |
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.
This mutable variable seems like a bad design choice
Formatting also needs to be applied: |
Static subanalyses are divided into different batches and summarized by the strategies in order to shorten the runtime.
This approach offers 4 strategies:
Single Phase Scheduling (SPS) - All sub-analyses are put into one batch and executed (may lead to wrong results in some cases. Further research needed).
Maximum Phase Scheduling (MP)- This strategy tries to create the most phases from the given analyses.
Independent Phase Merge Scheduling (IPMS) - An extension of the MPS strategy that executes independent phases together.
Smallest Phase Merge Scheduling (SPMS) - Also an extension of the MPS strategy, which merges independent phases into one phase based on the number of partial analyses.
There is also a Lazy Transformer Multiple Phase Flag, which allows the analyses to schedule lazy and transformer partial analyses in multiple phases.