From 608705530515037a3d4a57f566e9df1b15e4209a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 28 Feb 2026 10:19:18 +0900 Subject: [PATCH] Enable uint64 compareRanks on arm64 Extend the uint64 rank comparison trick (comparing [4]uint16 as a single uint64) to arm64 builds. ARM64 is little-endian like x86, so the same unsafe.Pointer cast produces correct lexicographic ordering. This replaces a 4-iteration loop with a single uint64 comparison, speeding up the sort phase. Chromium file list, single-threaded: linux: 126ms -> 126ms (sort not dominant) src: 462ms -> 438ms (-5%, sort-heavy) --- src/result_others.go | 2 +- src/result_x86.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/result_others.go b/src/result_others.go index 0d9dcd7c..bee8c89b 100644 --- a/src/result_others.go +++ b/src/result_others.go @@ -1,4 +1,4 @@ -//go:build !386 && !amd64 +//go:build !386 && !amd64 && !arm64 package fzf diff --git a/src/result_x86.go b/src/result_x86.go index 3e3fd58e..1438e078 100644 --- a/src/result_x86.go +++ b/src/result_x86.go @@ -1,4 +1,4 @@ -//go:build 386 || amd64 +//go:build 386 || amd64 || arm64 package fzf