mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-04 06:38:37 +00:00
mitchell's touchups
- benchmark: avoid buffers to avoid a memcpy - build: keep frame pointers on macOS. There was some debug changes from Zig 0.15 and this helps. Also, Apple actually requires/expects x29 to always be a frame pointer. - build/macos: force libSystem symbols instead of compiler-rt - global: add InitOpts.tool so that ghostty-gen/bench can parse their own actions in `+action` - quirks: provide our own vectorized memset. see the comment for more details why. - synthetic: fix UB by accessing global.io before it was initialized - terminal/hash_map: force inline for unique repr types. Zig 0.15 inlined and 0.16 doesn't, measured a huge slowdown in hyperlink benchmarks. - terminal: add explicit `@Vector` usage for storing a run of identical cells as well as for scanning printable cells. This auto-vectorized in Zig 0.15 but not in Zig 0.16. This produces the same assembly. - unicode: properties and LUT need power-of-two backing integer to avoid bad LLVM codegen
This commit is contained in:
@@ -113,8 +113,10 @@ fn step(ptr: *anyopaque) Benchmark.Error!void {
|
||||
// aren't currently IO bound.
|
||||
const f = self.data_f orelse return;
|
||||
|
||||
var read_buf: [64 * 1024]u8 align(std.atomic.cache_line) = undefined;
|
||||
var f_reader = f.reader(global.io(), &read_buf);
|
||||
// Unbuffered: readSliceShort below reads directly into `buf`,
|
||||
// avoiding a per-chunk memcpy through an intermediate reader
|
||||
// buffer that would pollute the measurement.
|
||||
var f_reader = f.reader(global.io(), &.{});
|
||||
const r = &f_reader.interface;
|
||||
|
||||
// This buffer size matches the read buffer size used by the
|
||||
|
||||
@@ -46,7 +46,7 @@ pub const Action = enum {
|
||||
|
||||
/// An entrypoint for the benchmark CLI.
|
||||
pub fn main(init: std.process.Init) !void {
|
||||
try global.init(.{ .main = init });
|
||||
try global.init(.{ .tool = init });
|
||||
const alloc = std.heap.c_allocator;
|
||||
const action_ = try cli.action.detectArgs(Action, alloc, init.minimal.args);
|
||||
const action = action_ orelse return error.NoAction;
|
||||
|
||||
Reference in New Issue
Block a user