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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:48:20+00:00 2026-06-04T11:48:20+00:00

This article http://www.gnustep.org/resources/ObjCFun.html states that Anywhere that time is critical, it’s possible in Objective-C

  • 0

This article http://www.gnustep.org/resources/ObjCFun.html states that

Anywhere that time is critical, it’s possible in Objective-C to pre-bind a message to its implementation, thus avoiding the expensive message lookup.

How do you do this pre-binding? This is not about selectors, is it?

  • 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-06-04T11:48:21+00:00Added an answer on June 4, 2026 at 11:48 am

    It involves implementations. Consider the following (+1 internets if you get the reference):

    NSArray *myReallyLongArrayOf1000items;
    
    for (int i = 0; i < 1000; i++)
        NSLog(@"%@", [myReallyLongArrayOf1000items objectAtIndex:i]);
    

    It takes time for the obj-c runtime to look up exactly how to perform the -objectAtIndex: task. Thus, when we change the block of code to this:

    NSArray *myReallyLongArrayOf1000items;
    
    id (*objectAtIndex)(NSArray *, SEL, int) = (typeof(objectAtIndex)) [myReallyLongArrayOf1000items methodForSelector:@selector(objectAtIndex:)];
    
    for (int i = 0; i < 1000; i++)
        NSLog(@"%@", objectAtIndex(myReallyLongArrayOf1000items, @selector(objectAtIndex:), i);
    

    This uses a C function-pointer, which is much faster than a dynamic look up with objective-c, as it simply calls the method, and does no extra runtime code.

    On the downside, this quickly makes code hard to read, so use this sparingly, if at all.

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

Sidebar

Related Questions

In this article: http://www.ibm.com/developerworks/java/library/j-jtp1029/index.html Brian Goetz states: Just because class X is compiled against
I've managed to setup jboss as windows service found this article http://www.jboss.org/jbossweb/install/service.html When I
I installed haml-mode in my Emacs follow this article http://www.emacswiki.org/emacs/HamlMode There is my code
I was reading this article on Coding Horror: http://www.codinghorror.com/blog/2008/04/setting-up-subversion-on-windows.html I went to the downloads
http://www.oracle.com/technetwork/articles/javase/index-140168.html#binsch - This article says JAXB requires that the XML document you want to
I followed this tutorial and got the basics of Content Providers : http://www.vogella.de/articles/AndroidSQLite/article.html But
Can somebody explain me the flow of control in this tutorial : http://www.vogella.de/articles/AndroidSQLite/article.html#tutorialusecp I
I stumbled upon this article http://www.thefloatingfrog.co.uk/css/my-hatred-of-br-clearall/ When would one need to use that ?
In this article http://www.kashit.org/design/css/ultimate-guide-to-techniques-for-cross-browser-css/ under section Fixing IE Box Model Bug author wrote IE
I found this article: http://www.deluxeblogtips.com/2010/05/editor-style-wordpress-30.html I created a child theme using the Twentyten theme

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.