This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ObjC: another tiny performance tidyup


This saves a few thousands strlen() calls per compilation by reusing
the length of selector strings instead of calculating it again.

Ok to commit ?

Thanks

PS: I'll come back to hashtables later, as they do deserve some
discussion.  I want to get all the other obvious tiny changes in
first.

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 172338)
+++ ChangeLog   (working copy)
@@ -1,5 +1,10 @@
 2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>
 
+       * objc-act.c (build_keyword_selector): Use get_identifier_with_length
+       instead of get_identifier.
+
+2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>
+
        * objc-act.c (objc_build_message_expr): Accept two arguments
        instead of one so that callers can simply pass the arguments
        without having to create a temporary chain to hold them.
Index: objc-act.c
===================================================================
--- objc-act.c  (revision 172338)
+++ objc-act.c  (working copy)
@@ -4668,7 +4668,7 @@ build_keyword_selector (tree selector)
       strcat (buf, ":");
     }
 
-  return get_identifier (buf);
+  return get_identifier_with_length (buf, len);
 }
 
 /* Used for declarations and definitions.  */



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]