mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
bench: update codepoint-width
This commit is contained in:
@ -29,8 +29,6 @@ hyperfine \
|
|||||||
"./zig-out/bin/bench-codepoint-width --mode=wcwidth${ARGS} </tmp/ghostty_bench_data" \
|
"./zig-out/bin/bench-codepoint-width --mode=wcwidth${ARGS} </tmp/ghostty_bench_data" \
|
||||||
-n utf8proc \
|
-n utf8proc \
|
||||||
"./zig-out/bin/bench-codepoint-width --mode=utf8proc${ARGS} </tmp/ghostty_bench_data" \
|
"./zig-out/bin/bench-codepoint-width --mode=utf8proc${ARGS} </tmp/ghostty_bench_data" \
|
||||||
-n ziglyph \
|
|
||||||
"./zig-out/bin/bench-codepoint-width --mode=ziglyph${ARGS} </tmp/ghostty_bench_data" \
|
|
||||||
-n table \
|
-n table \
|
||||||
"./zig-out/bin/bench-codepoint-width --mode=table${ARGS} </tmp/ghostty_bench_data" \
|
"./zig-out/bin/bench-codepoint-width --mode=table${ARGS} </tmp/ghostty_bench_data" \
|
||||||
-n simd \
|
-n simd \
|
||||||
|
@ -172,7 +172,9 @@ noinline fn benchTable(
|
|||||||
const cp_, const consumed = d.next(c);
|
const cp_, const consumed = d.next(c);
|
||||||
assert(consumed);
|
assert(consumed);
|
||||||
if (cp_) |cp| {
|
if (cp_) |cp| {
|
||||||
const width = table.get(@intCast(cp)).width;
|
// This is the same trick we do in terminal.zig so we
|
||||||
|
// keep it here.
|
||||||
|
const width = if (cp <= 0xFF) 1 else table.get(@intCast(cp)).width;
|
||||||
|
|
||||||
// Write the width to the buffer to avoid it being compiled away
|
// Write the width to the buffer to avoid it being compiled away
|
||||||
buf[0] = @intCast(width);
|
buf[0] = @intCast(width);
|
||||||
|
Reference in New Issue
Block a user