Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 629597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:45:49+00:00 2026-05-13T19:45:49+00:00

I have a custom class I use frequently on my projects. This class has

  • 0

I have a custom class I use frequently on my projects. This class has several methods but not all of them are used in every project.

My question is: including this class on a Project will bloat the project with useless code or will the compiler just include the methods used?

I mean, if my class has 30 methods but just 4 are being used in a given project will the compiler include also the other unused 26 or just the 4 used in the final product?

In case it includes all, is there a way to force it to disregard the unused methods and trim the binary to the minimum?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:45:50+00:00Added an answer on May 13, 2026 at 7:45 pm

    The linker supports dead-stripping, if you turn it on unused code should not cause any bloat.

    From the Apple docs:

    The static linker (ld) supports the
    removal of unused code and data blocks
    from executable files. This process
    (known as dead-code stripping) helps
    reduce the overall size of
    executables, which in turn improves
    performance by reducing the memory
    footprint of the executable. It also
    allows programs to link successfully
    when unused code refers to an
    undefined symbol (instead of resulting
    in a link error).

    Dead-code stripping is not limited to
    removing only unused functions and
    executable code from a binary. The
    linker also removes any unused symbols
    and data that reside in data blocks.
    Such symbols might include global
    variables, static variables, and
    string data, among others.

    When dead-code stripping is enabled,
    the static linker searches for code
    that is unreachable from an initial
    set of live symbols and blocks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom container class for which I'd like to write the iterator
I have a custom database class that I wrote myself, and I also have
Suppose I have a custom collection class that provides some internal thread synchronization. For
i have many objects of the same custom class, and another many objects of
Basically, I have a custom templated control with a custom data container class. When
When I use the zend CLI to create a form, like this, a form
I have custom validators and filters that I have created that I would like
I have a class A that I overload its operator=. However it is required
I'm trying to make Core Data objects inherit from my own custom class rather
Is storing a list of 1000 instance of my custom class to the session

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.