mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 20:09:04 +00:00
Use macOS signpost api for tracing (#14871)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com> Co-authored-by: Don Isaac <donald.isaac@gmail.com> Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com> Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
@@ -3159,7 +3159,7 @@ pub const Parser = struct {
|
||||
|
||||
// Parse the file in the first pass, but do not bind symbols
|
||||
var opts = ParseStatementOptions{ .is_module_scope = true };
|
||||
const parse_tracer = bun.tracy.traceNamed(@src(), "JSParser.parse");
|
||||
const parse_tracer = bun.perf.trace("JSParser.parse");
|
||||
|
||||
const stmts = p.parseStmtsUpTo(js_lexer.T.t_end_of_file, &opts) catch |err| {
|
||||
if (comptime Environment.isWasm) {
|
||||
@@ -3197,7 +3197,7 @@ pub const Parser = struct {
|
||||
return error.SyntaxError;
|
||||
}
|
||||
|
||||
const visit_tracer = bun.tracy.traceNamed(@src(), "JSParser.visit");
|
||||
const visit_tracer = bun.perf.trace("JSParser.visit");
|
||||
try p.prepareForVisitPass();
|
||||
|
||||
var parts = ListManaged(js_ast.Part).init(p.allocator);
|
||||
@@ -3206,7 +3206,7 @@ pub const Parser = struct {
|
||||
try p.appendPart(&parts, stmts);
|
||||
visit_tracer.end();
|
||||
|
||||
const analyze_tracer = bun.tracy.traceNamed(@src(), "JSParser.analyze");
|
||||
const analyze_tracer = bun.perf.trace("JSParser.analyze");
|
||||
try callback(context, &p, parts.items);
|
||||
analyze_tracer.end();
|
||||
}
|
||||
@@ -3292,7 +3292,7 @@ pub const Parser = struct {
|
||||
|
||||
// Parse the file in the first pass, but do not bind symbols
|
||||
var opts = ParseStatementOptions{ .is_module_scope = true };
|
||||
const parse_tracer = bun.tracy.traceNamed(@src(), "JSParser.parse");
|
||||
const parse_tracer = bun.perf.trace("JSParser.parse");
|
||||
|
||||
// Parsing seems to take around 2x as much time as visiting.
|
||||
// Which makes sense.
|
||||
@@ -3324,7 +3324,7 @@ pub const Parser = struct {
|
||||
|
||||
bun.crash_handler.current_action = .{ .visit = self.source.path.text };
|
||||
|
||||
const visit_tracer = bun.tracy.traceNamed(@src(), "JSParser.visit");
|
||||
const visit_tracer = bun.perf.trace("JSParser.visit");
|
||||
try p.prepareForVisitPass();
|
||||
|
||||
var before = ListManaged(js_ast.Part).init(p.allocator);
|
||||
@@ -3531,7 +3531,7 @@ pub const Parser = struct {
|
||||
return error.SyntaxError;
|
||||
}
|
||||
|
||||
const postvisit_tracer = bun.tracy.traceNamed(@src(), "JSParser.postvisit");
|
||||
const postvisit_tracer = bun.perf.trace("JSParser.postvisit");
|
||||
defer postvisit_tracer.end();
|
||||
|
||||
var uses_dirname = p.symbols.items[p.dirname_ref.innerIndex()].use_count_estimate > 0;
|
||||
|
||||
Reference in New Issue
Block a user