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 7511819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:40:31+00:00 2026-05-29T23:40:31+00:00

I am working on performance improvement of my ios cocos2d game. I was checking

  • 0

I am working on performance improvement of my ios cocos2d game. I was checking memory allocations of the app with the help of Instruments tool when I noticed one thing. There are too many CFString objects being declared and held by [NSBundle mainBundle] call. It says,

Category: CFString (immutable)
Responsible Caller: [NSBundle mainBundle]

There are many places in my code where I wrote following lines

[[NSBundle mainBundle] pathForResource:@"resource-name" ofType:@"png" isDirectory:imageDirectory];

Is this CFString problem is because of above code because I am giving a hard coded string in pathForResource method? Or what can be reason of this issue? Can anyone please help? This CFString allocations is taking about 2Mb of my code so I am worried about it.

Best Regards

  • 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-29T23:40:33+00:00Added an answer on May 29, 2026 at 11:40 pm

    These CFString’s are due to having a large number of resources in your application bundle. In my testing I found 1 CFString allocated for each file at the root of the bundle. Presumably this is some kind of caching of path names.

    I am currently working on an app with 1,000’s of resources in the bundle and these immutable strings are taking up ~ 300K. When I remove the majority of them, I wind up with about 20K, with around 100 CFStrings for ~ 80 resources in the bundle.

    It seems like the answer to reducing these is to put Resources in sub-directories within the bundle. You can use a “Folder Reference” in Xcode to do this.

    For example, you might have 1,000 PNGs for your game. Put those in a folder called “Assets” in your project (on disk). Drag the “Assets” directory to Xcode and instead of creating a Group, create a Folder Reference.

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

Sidebar

Related Questions

I'm working on some Oracle performance issues with our web app. One thing I've
I am working on improving the performance of my app. I am confused about
I was working with ANTS Performance Profiler for few days and one of the
I am working on website performance and need a little bit of help determining
I am working on performance optimizations of ARM C/C++ code, compiled with GCC. CPU
I am working on performance tuning of a java rmi application and using OQL
I am working on a performance test which involves several clients bombarding the server
How much does the garbage collector affect performance when working with lots of objects
I'm working on SQL SERVER 2008 R2 Performance tunning part but I'm new in
I am working on a MVC project and the performance was fine. On application_start

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.