summaryrefslogtreecommitdiff
path: root/src/FrameStats.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 11:40:11 -0300
committerGabriel Schneider <[email protected]>2026-11-05 12:41:36 -0300
commit3f1533813b6692a736251e4d467a7f108229ddee (patch)
tree37a32c5ebbf9d3af08923856fd6fa516f3b33a39 /src/FrameStats.zig
parentcfd2b993feda1b3f7474225bb32db8cac8edc5ae (diff)
downloadpardes-3f1533813b6692a736251e4d467a7f108229ddee.tar.gz
pardes-3f1533813b6692a736251e4d467a7f108229ddee.zip
targets: the DOM web shell goes (src/web.zig and src/web/, its harnesses web_harness, web_snapshot, web_driver_test and web-snapshots/, tools/web_fixture.py, -Dplatform=web, -Ddump, and the web, web-harness, web-snap, web-e2e and web-driver-test steps), and with it what only a freestanding build needed: `hosted` and every guard on it (every build has a host now), memory's stack-fallback arenas and reduced_target sizes, the emscripten main, the tree-sitter libc shim and the stb stub, lsp's has_client, the web arms of the platform switches (-Dplatform is tui, gui or macos); the macOS files pass zig ast-check; docs/web.md is a paragraph on what it was
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/FrameStats.zig')
-rw-r--r--src/FrameStats.zig6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/FrameStats.zig b/src/FrameStats.zig
index 680987fb..623acd24 100644
--- a/src/FrameStats.zig
+++ b/src/FrameStats.zig
@@ -137,7 +137,6 @@ pub fn zone(stats: *FrameStats, which: Zone, from_ns: u64) void {
}
pub fn nowNs() u64 {
- if (comptime !pardes.hosted) return 0;
var ts: std.c.timespec = undefined;
if (std.c.clock_gettime(.MONOTONIC, &ts) != 0) return 0;
return @as(u64, @intCast(ts.sec)) *| std.time.ns_per_s +| @as(u64, @intCast(ts.nsec));
@@ -181,9 +180,9 @@ pub fn record(stats: *FrameStats, end_ns: u64, moving: bool, skipped: bool) void
if (stats.armed and @as(u64, gap) * std.time.ns_per_us * 2 > stats.period_ns * 3) stats.jank += 1;
if (@as(u64, frame.update_us + frame.render_us + frame.present_us) * std.time.ns_per_us > stats.period_ns) stats.over_budget += 1;
if (skipped) stats.skipped += 1;
- if (comptime pardes.hosted) if (stats.count == 0 and std.c.getenv("PARDES_FRAMES") != null) {
+ if (stats.count == 0 and std.c.getenv("PARDES_FRAMES") != null) {
stats.long = std.heap.page_allocator.create([long_capacity]Frame) catch null;
- };
+ }
const ring: []Frame = if (stats.long) |long| long else &stats.ring;
ring[@intCast(stats.count % ring.len)] = frame;
stats.count += 1;
@@ -263,7 +262,6 @@ pub fn summary(stats: *const FrameStats, buf: []u8) []const u8 {
/// Writes the summary and every frame the ring holds to `path`: a header
/// of `# ` lines, then one tab-separated line a frame. The long ring goes.
pub fn dump(stats: *FrameStats, path: [:0]const u8) void {
- if (comptime !pardes.hosted) return;
defer if (stats.long) |long| {
std.heap.page_allocator.destroy(long);
stats.long = null;