docs/adr/00002-support-event-trace-profiling.md
Technical Story: Issue 3071 <!-- optional -->
SWC wants to provide user-level feature to collect diagnostic information for its performances to allow to monitor, resolve real-world performance issues if user encounters one.
[option 1] Run profilers like perf, instruments
[option 2] Provide a traceable binary enables tracing capabilities all time, emits trace event format compatible output
[option 3] Release binary provides runtime flags to enable tracing, emits trace event format compatible output
[option 4] Either creating separate binary or provide runtime flags, emits raw trace outputs let user convert into own preferable way
Chosen option: [option 3] Release binary provides runtime flags to enable tracing, emits trace event format compatible output
This decision is taken because
perf, instrumentsSWC does not implement any internal tracing features, let user rely on own profiler
traceable binary enables tracing capabilities all time, emits trace event format compatible outputSWC implements internal logics to generate traceable outputs, which is compatible to trace event format. However, it is not included in normal release binary (@swc/core) but requires to install specific custom binary to opt in.
SWC implements internal logics to generate traceable outputs, which is compatible to trace event format. It is included in release binary by default which can be enabled via cli flags, or programmatic interfaces.
SWC follows option 2 or 3, however its emitted output is not compatible to trace event format but raw values from tracing infrastructure