This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ObjC: another tiny performance tidyup
- From: "Nicola Pero" <nicola dot pero at meta-innovation dot com>
- To: "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>
- Date: Tue, 12 Apr 2011 21:12:11 +0200 (CEST)
- Subject: 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. */