Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: RFA: add C++ alternate punctuators
Date: Sat, 20 Dec 2008 17:45:00 -0000	[thread overview]
Message-ID: <m3hc4yeo60.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20081220171526.GA30284@caradoc.them.org> (Daniel Jacobowitz's message of "Sat\, 20 Dec 2008 12\:15\:26 -0500")

>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

Daniel> Does anything performance sensitive use this lexer, or is that likely
Daniel> in the future?  I suspect this version will be quite a lot slower;
Daniel> it has a string copy and a linear search.

I don't know whether it is performance sensitive in general.
I haven't tried profiling in this area.

The string copy is already done in the not-a-keyword case.  So, if
this part of the patch negatively affects performance, then it would
only do so for the case of expressions weighted toward use of
keywords.  That doesn't seem like a scenario worth worrying about.

We already linearly search two other tables for every token, not just
keywords.  This doesn't justify adding another one, but it does
suggest that it hasn't hurt so far.

Anyway, the above was my reasoning when I wrote the patch.  Also, I
thought using a table would make it a little less error-prone to add
new keywords in the future.  (I think we are missing 7 relevant ones.)

I can rewrite it to use a hash table if you'd prefer.  Or just inline
the new keywords into the switch and delete the comment.  Let me know.

Tom


  reply	other threads:[~2008-12-20 17:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-20 15:58 Tom Tromey
2008-12-20 17:02 ` Pedro Alves
2008-12-20 17:16 ` Daniel Jacobowitz
2008-12-20 17:45   ` Tom Tromey [this message]
2008-12-20 20:26     ` Daniel Jacobowitz
2008-12-22 14:22       ` Tom Tromey
2008-12-23 10:02         ` Jan Kratochvil
2008-12-23 16:36           ` Tom Tromey
2008-12-23 17:21             ` Jan Kratochvil
2008-12-23 17:02           ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3hc4yeo60.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox