Skip to content

A Clearer Timing/Logging Format in tai-e.log #181

@Michael1015198808

Description

@Michael1015198808

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.

Image

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:

  1. PointerAnalysis starts timing
  2. PointerAnalysis calls the IRBuilder and therefore count the IR building time into the overall time cost.
  3. PointerAnalysis starts its main logic (with the log pta starts ...)
  4. 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:

  1. IRBuilder builds/loads the IR.
  2. PointerAnalysis starts timing
  3. PointerAnalysis finds that IR is already there and starts its main logic immediately
  4. 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions