Build the menu IPC payload with jq instead of perl

Forking perl to produce {"menu":"<route>"} cost more than the IPC call it
fed. jq is already a runtime dependency and emits identical JSON.

Opening the menu drops from ~42ms to ~28ms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-08-10 13:33:07 -07:00
co-authored by Claude Opus 5
parent e4604fbcfb
commit 5649740f51
+1 -1
View File
@@ -13,7 +13,7 @@ verb="${1-toggle}"
route="${2-root}" route="${2-root}"
menu_payload() { menu_payload() {
perl -MEncode=decode -MJSON::PP=encode_json -e 'print encode_json({ menu => decode("UTF-8", $ARGV[0]) })' "$1" jq -nc --arg menu "$1" '{ menu: $menu }'
} }
case "$verb" in case "$verb" in