Skip to content

perf(desktop): strip local symbols from the bundled macOS ONNX Runtime - #2765

Open
richiemcilroy wants to merge 1 commit into
mainfrom
perf/strip-macos-onnxruntime
Open

richiemcilroy wants to merge 1 commit into
mainfrom
perf/strip-macos-onnxruntime

Conversation

@richiemcilroy

Copy link
Copy Markdown
Member

What

Contents/Resources/onnxruntime/lib/libonnxruntime.dylib is Microsoft's release dylib, 35.2 MB, used on macOS by Parakeet transcription and as the camera-blur fallback when Apple Vision is unavailable. About 12.5 MB of it is local symbol tables that nothing in Cap reads.

setup.js now runs strip -x on it before re-signing (it already re-signs the dylib with Cap's identity for notarization). The cache marker changes with the preparation, so a cached unstripped copy is prepared again.

Evidence

Measured on the 0.6.1 release bundle's dylib (arm64, ONNX Runtime 1.24.2):

Before strip -x
Size 35.17 MB 22.68 MB
Exported symbols (nm -gU) 3 3 (identical list, incl. OrtGetApiBase)

-x removes local symbols only. The exported C API that ort resolves at load time is untouched.

CI (build-gpui, both macOS runners) gains "Test the prepared ONNX Runtime":

  • it asserts OrtGetApiBase is still exported from the dylib setup.js prepared;
  • it runs the previously ignored segmentation::tests::inference_runs_from_a_caller_with_a_tiny_stack, which loads the runtime and runs the bundled selfie-segmentation model three times.

scripts/setup.js is added to the gpui path filter so this runs whenever setup changes.

The FFmpeg dylibs in Spacedrive.framework were checked the same way; they are already stripped (strip -x saves 0 bytes).

Saves

~12.5 MB installed on Apple Silicon (the Intel 1.23.2 dylib is stripped by the same step). The updater archive and DMG shrink by the compressed size of those symbol tables.

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cap-status Ready Ready Preview Oct 20, 2026 12:42pm UTC

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 2 other findings in Capy.

Open in Capy

This branch was successfully deployed

2 active deployments
Preview – cap-web — af9978f1 Deployed Oct 20, 2026 by vercel[bot]
Preview – cap-status — af9978f1 Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant