Clear and concise description of the problem
Tai-e currently logs when an analysis (including IRBuilder, PointerAnalysis, and so on) reaches its end, but barely logs the starting. This may make the log a little bit ambiguous:
In the following example, I ran the same analysis twice, the first one without --world-cache-mode while the second with --world-cache-mode.
As the red line shows, the runtime of pointer analysis on the right hand side is much faster! This could be a little misleading as pta starts ... comes after the IR is created.
After consulting a core developer, I found that this is because of the timing logic.
When --world-cache-mode is off or the cache is not ready, the analysis is like:
PointerAnalysis starts timing
PointerAnalysis calls the IRBuilder and therefore count the IR building time into the overall time cost.
PointerAnalysis starts its main logic (with the log pta starts ...)
PointerAnalysis finishes timing
But when one of the following is satisfied:
a) --world-cache-mode is on and the cache is ready
b) --pre-build-ir is on
The analysis is like:
IRBuilder builds/loads the IR.
PointerAnalysis starts timing
PointerAnalysis finds that IR is already there and starts its main logic immediately
PointerAnalysis finishes timing
Therefore, the IR building time is included in the first setting but excluded in the second setting. This could be a little misleading and confusing as the user cannot tell this fact from the log.
Impact Analysis
No response
Suggested Solution
No response
Alternative
No response
Intention to submit PR
No
Additional Context
No response
Clear and concise description of the problem
Tai-e currently logs when an analysis (including
IRBuilder,PointerAnalysis, and so on) reaches its end, but barely logs the starting. This may make the log a little bit ambiguous:In the following example, I ran the same analysis twice, the first one without
--world-cache-modewhile the second with--world-cache-mode.As the red line shows, the runtime of pointer analysis on the right hand side is much faster! This could be a little misleading as
pta starts ...comes after the IR is created.After consulting a core developer, I found that this is because of the timing logic.
When
--world-cache-modeis off or the cache is not ready, the analysis is like:PointerAnalysisstarts timingPointerAnalysiscalls theIRBuilderand therefore count the IR building time into the overall time cost.PointerAnalysisstarts its main logic (with the logpta starts ...)PointerAnalysisfinishes timingBut when one of the following is satisfied:
a)
--world-cache-modeis on and the cache is readyb)
--pre-build-iris onThe analysis is like:
IRBuilderbuilds/loads the IR.PointerAnalysisstarts timingPointerAnalysisfinds that IR is already there and starts its main logic immediatelyPointerAnalysisfinishes timingTherefore, the IR building time is included in the first setting but excluded in the second setting. This could be a little misleading and confusing as the user cannot tell this fact from the log.
Impact Analysis
No response
Suggested Solution
No response
Alternative
No response
Intention to submit PR
No
Additional Context
No response