From 4834b8e925b9ec598d4a34038d7188efc7698603 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 8 Feb 2024 21:10:37 -0800 Subject: [PATCH] remove utf8proc --- build.zig | 9 --------- build.zig.zon | 1 - src/bench/codepoint-width.sh | 2 -- src/bench/codepoint-width.zig | 30 +----------------------------- 4 files changed, 1 insertion(+), 41 deletions(-) diff --git a/build.zig b/build.zig index ff837b70d..4e6febe12 100644 --- a/build.zig +++ b/build.zig @@ -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()); diff --git a/build.zig.zon b/build.zig.zon index c3b958591..a694562ea 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -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" }, diff --git a/src/bench/codepoint-width.sh b/src/bench/codepoint-width.sh index 83d01830b..43304ec2e 100755 --- a/src/bench/codepoint-width.sh +++ b/src/bench/codepoint-width.sh @@ -27,8 +27,6 @@ hyperfine \ "./zig-out/bin/bench-codepoint-width --mode=noop${ARGS} 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,