mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
remove utf8proc
This commit is contained in:
@ -1082,15 +1082,6 @@ fn addDeps(
|
||||
step.linkLibrary(utfcpp_dep.artifact("utfcpp"));
|
||||
try static_libs.append(utfcpp_dep.artifact("utfcpp").getEmittedBin());
|
||||
|
||||
// utf8proc
|
||||
const utf8proc_dep = b.dependency("utf8proc", .{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
step.root_module.addImport("utf8proc", utf8proc_dep.module("utf8proc"));
|
||||
step.linkLibrary(utf8proc_dep.artifact("utf8proc"));
|
||||
try static_libs.append(utf8proc_dep.artifact("utf8proc").getEmittedBin());
|
||||
|
||||
// Spirv-Cross
|
||||
step.linkLibrary(spirv_cross_dep.artifact("spirv_cross"));
|
||||
try static_libs.append(spirv_cross_dep.artifact("spirv_cross").getEmittedBin());
|
||||
|
@ -38,7 +38,6 @@
|
||||
.opengl = .{ .path = "./pkg/opengl" },
|
||||
.pixman = .{ .path = "./pkg/pixman" },
|
||||
.simdutf = .{ .path = "./pkg/simdutf" },
|
||||
.utf8proc = .{ .path = "./pkg/utf8proc" },
|
||||
.utfcpp = .{ .path = "./pkg/utfcpp" },
|
||||
.zlib = .{ .path = "./pkg/zlib" },
|
||||
|
||||
|
@ -27,8 +27,6 @@ hyperfine \
|
||||
"./zig-out/bin/bench-codepoint-width --mode=noop${ARGS} </tmp/ghostty_bench_data" \
|
||||
-n wcwidth \
|
||||
"./zig-out/bin/bench-codepoint-width --mode=wcwidth${ARGS} </tmp/ghostty_bench_data" \
|
||||
-n utf8proc \
|
||||
"./zig-out/bin/bench-codepoint-width --mode=utf8proc${ARGS} </tmp/ghostty_bench_data" \
|
||||
-n table \
|
||||
"./zig-out/bin/bench-codepoint-width --mode=table${ARGS} </tmp/ghostty_bench_data" \
|
||||
-n simd \
|
||||
|
@ -46,15 +46,13 @@ const Mode = enum {
|
||||
/// libc wcwidth
|
||||
wcwidth,
|
||||
|
||||
/// Use utf8proc library to calculate the display width of each codepoint.
|
||||
utf8proc,
|
||||
|
||||
/// Use ziglyph library to calculate the display width of each codepoint.
|
||||
ziglyph,
|
||||
|
||||
/// Our SIMD implementation.
|
||||
simd,
|
||||
|
||||
/// Test our lookup table implementation.
|
||||
table,
|
||||
};
|
||||
|
||||
@ -82,7 +80,6 @@ pub fn main() !void {
|
||||
switch (args.mode) {
|
||||
.noop => try benchNoop(reader, buf),
|
||||
.wcwidth => try benchWcwidth(reader, buf),
|
||||
.utf8proc => try benchUtf8proc(reader, buf),
|
||||
.ziglyph => try benchZiglyph(reader, buf),
|
||||
.simd => try benchSimd(reader, buf),
|
||||
.table => try benchTable(reader, buf),
|
||||
@ -132,31 +129,6 @@ noinline fn benchWcwidth(
|
||||
}
|
||||
}
|
||||
|
||||
noinline fn benchUtf8proc(
|
||||
reader: anytype,
|
||||
buf: []u8,
|
||||
) !void {
|
||||
const utf8proc = @import("utf8proc");
|
||||
var d: UTF8Decoder = .{};
|
||||
while (true) {
|
||||
const n = try reader.read(buf);
|
||||
if (n == 0) break;
|
||||
|
||||
// Using stream.next directly with a for loop applies a naive
|
||||
// scalar approach.
|
||||
for (buf[0..n]) |c| {
|
||||
const cp_, const consumed = d.next(c);
|
||||
assert(consumed);
|
||||
if (cp_) |cp| {
|
||||
const width = utf8proc.charwidth(cp);
|
||||
|
||||
// Write the width to the buffer to avoid it being compiled away
|
||||
buf[0] = @intCast(width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
noinline fn benchTable(
|
||||
reader: anytype,
|
||||
buf: []u8,
|
||||
|
Reference in New Issue
Block a user