Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Arti Arti
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 136
    • Issues 136
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • ArtiArti
  • Merge requests
  • !124

Tune the 'profile.release' options for a smaller compile size.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Nick Mathewson requested to merge nickm/arti:binary_size into main Nov 08, 2021
  • Overview 3
  • Commits 1
  • Pipelines 1
  • Changes 1

By enabling link-time optimization, setting 'opt-level=s', and setting compilation-units=1, we can get a much smaller download size, which is one of our objectives.

Making these changes reduces the binary size for me (on x86_64) by about 42%. If you also run "strip --strip-debug" on the resulting binary, the resulting size is 55% smaller than the original binary size.

These effects persist if you compress the binary. Supposing that we use xz compression, these options make save 32% of compressed binary size. If we also "strip --strip-debug" before compressing, the compressed binary saves 43% from the original binary size.

With all of these options applied, on x86_64 linux with xz compression, we're at a nice 1.5 MiB download. If we statically link to openssl and sqlite, we're still only at a 2.8 MiB download.

There is a build time cost to these changes: for me, it comes to a 10%-25% build time increase.

This is part of #172 (closed).

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: binary_size