public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* ObjC: another tiny performance tidyup
@ 2011-04-12 19:12 Nicola Pero
  2011-04-12 20:25 ` Mike Stump
  0 siblings, 1 reply; 2+ messages in thread
From: Nicola Pero @ 2011-04-12 19:12 UTC (permalink / raw)
  To: gcc-patches

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.  */


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ObjC: another tiny performance tidyup
  2011-04-12 19:12 ObjC: another tiny performance tidyup Nicola Pero
@ 2011-04-12 20:25 ` Mike Stump
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Stump @ 2011-04-12 20:25 UTC (permalink / raw)
  To: Nicola Pero; +Cc: gcc-patches

On Apr 12, 2011, at 12:12 PM, Nicola Pero wrote:
> This saves a few thousands strlen() calls per compilation by reusing
> the length of selector strings instead of calculating it again.
> 
> Ok to commit ?

Ok.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-12 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12 19:12 ObjC: another tiny performance tidyup Nicola Pero
2011-04-12 20:25 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).