usx95 wrote:

What is the reason for changing from `llvm::TimeTraceProfilerEntry*` to 
`std::shared_ptr<DurableEvent>`? We are also adding significant 
devirtualization cost with the added different event types.
Can we do something like this:
```
enum class TimeTraceEventType { DurationEvent, InstantEvent };
struct llvm::TimeTraceProfilerEntry {
  const TimePointType Start;
  TimePointType End;
  const std::string Name;
  TimeTraceMetadata Metadata;
  TimeTraceEventType EventType;
  std::vector<std::unique_ptr<TimeTraceProfilerEntry>> InstantEvents; // 
Instant event associated to a duration event.
}
```
This will remove the need for different implementations for each event type and 
reduce the complexity.

We can also move the `TimeTraceProfilerEntry` decl to `TimeProfiler.h`. I do 
not see a point of having just a forward decl

https://github.com/llvm/llvm-project/pull/103039
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to