Skip to content

Commit 49e66d7

Browse files
committed
fix: Fix show_perf
1 parent 48c9fdc commit 49e66d7

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/Jit.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ call_count: u128 = 0,
115115
/// Keeps track of time spent in the JIT
116116
jit_time: usize = 0,
117117
/// Closures already compiled (hash is bytecode list), useful to compile once a function
118-
compiled_functions_bodies: Chunk.HashMap(CompiledFunction),
118+
compiled_functions_bodies: Chunk.HashMap(CompiledFunction) = .empty,
119119

120120
args_buffer: [255]m.MIR_op_t = undefined,
121121

src/main.zig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,19 +159,19 @@ pub fn runFile(allocator: Allocator, file_name: []const u8, args: []const []cons
159159
if (BuildOptions.show_perf and flavor != .Check and flavor != .Fmt) {
160160
io.print(
161161
if (builtin.os.tag != .windows)
162-
"\x1b[2mParsing: {[parsing]d}\nCodegen: {[codegen]d}\nRun: {[running]d}\nJIT: {[jit]d}\nGC: {[gc]d}\nTotal: {[total]}\nFull GC: {[gc_full]} | GC: {[gc_light]} | Max allocated: {[max_alloc]}\n\x1b[0m"
162+
"\x1b[2mParsing: {[parsing]D}\nCodegen: {[codegen]D}\nRun: {[running]D}\nJIT: {[jit]D}\nGC: {[gc]D}\nTotal: {[total]D}\nFull GC: {[gc_full]} | GC: {[gc_light]} | Max allocated: {[max_alloc]B}\n\x1b[0m"
163163
else
164-
"Parsing: {[parsing]d}\nCodegen: {[codegen]d}\nRun: {[running]d}\nJIT: {[jit]d}\nGC: {[gc]d}\nTotal: {[total]}\nFull GC: {[gc_full]} | GC: {[gc_light]} | Max allocated: {[max_alloc]}\n",
164+
"Parsing: {[parsing]D}\nCodegen: {[codegen]D}\nRun: {[running]D}\nJIT: {[jit]D}\nGC: {[gc]D}\nTotal: {[total]D}\nFull GC: {[gc_full]} | GC: {[gc_light]} | Max allocated: {[max_alloc]B}\n",
165165
.{
166-
.parsing = std.fmt.fmtDuration(parsing_time),
167-
.codegen = std.fmt.fmtDuration(codegen_time),
168-
.running = std.fmt.fmtDuration(running_time),
169-
.jit = std.fmt.fmtDuration(if (vm.jit) |jit| jit.jit_time else 0),
170-
.gc = std.fmt.fmtDuration(gc.gc_time),
171-
.total = std.fmt.fmtDuration(if (!is_wasm) total_timer.read() else 0),
166+
.parsing = parsing_time,
167+
.codegen = codegen_time,
168+
.running = running_time,
169+
.jit = if (vm.jit) |jit| jit.jit_time else 0,
170+
.gc = gc.gc_time,
171+
.total = if (!is_wasm) total_timer.read() else 0,
172172
.gc_full = gc.full_collection_count,
173173
.gc_light = gc.light_collection_count,
174-
.max_alloc = std.fmt.fmtIntSizeDec(gc.max_allocated),
174+
.max_alloc = gc.max_allocated,
175175
},
176176
);
177177
}

src/repl.zig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -345,17 +345,17 @@ fn runSource(
345345

346346
if (BuildOptions.show_perf) {
347347
io.print(
348-
"\u{001b}[2mParsing: {d}\nCodegen: {d}\nRun: {d}\nJIT: {d}\nGC: {d}\nTotal: {d}\nFull GC: {} | GC: {} | Max allocated: {} bytes\n\u{001b}[0m",
348+
"\u{001b}[2mParsing: {D}\nCodegen: {D}\nRun: {D}\nJIT: {D}\nGC: {D}\nTotal: {D}\nFull GC: {} | GC: {} | Max allocated: {B} bytes\n\u{001b}[0m",
349349
.{
350-
std.fmt.fmtDuration(parsing_time),
351-
std.fmt.fmtDuration(codegen_time),
352-
std.fmt.fmtDuration(running_time),
353-
std.fmt.fmtDuration(if (vm.jit) |jit| jit.jit_time else 0),
354-
std.fmt.fmtDuration(gc.gc_time),
355-
std.fmt.fmtDuration(total_timer.read()),
350+
parsing_time,
351+
codegen_time,
352+
running_time,
353+
if (vm.jit) |jit| jit.jit_time else 0,
354+
gc.gc_time,
355+
total_timer.read(),
356356
gc.full_collection_count,
357357
gc.light_collection_count,
358-
std.fmt.fmtIntSizeDec(gc.max_allocated),
358+
gc.max_allocated,
359359
},
360360
);
361361
}

0 commit comments

Comments
 (0)