Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: rlane@club.cc.cmu.edu (Rich Lane)
Subject: [sup-talk] [PATCH] cache results of Person.from_address
Date: Sat, 22 Aug 2009 14:28:39 -0400	[thread overview]
Message-ID: <1250964897-sup-2990@zyrg.net> (raw)
In-Reply-To: <1250949615-sup-1773@masanjin.net>

Excerpts from William Morgan's message of Sat Aug 22 10:10:04 -0400 2009:
> This looks good. Two minor questions before I apply:
> 
> Reformatted excerpts from Rich Lane's message of 2009-08-16:
> > The regexes in this function are very expensive, so caching improves
> > performance significantly for queries and slightly for indexing.
> 
> When you say this affects query performance, is it just the contact-list
> query, or is there some other mechanism by which this is slowing down
> regular queries?

Actually, your question prompted me to wonder why we're calling
Person.from_address on this path at all. With a little support from
Message we can completely avoid Message#parse_header. I've just sent in
a patch that does this. Please apply that rather than the from_address
cache.

The performance improvement from the new patch is slightly better than
that of the cache. Depending on the benchmark I see the time taken by
ThreadIndexMode#load_n_threads decrease by 1/2 to 2/3.


      reply	other threads:[~2009-08-22 18:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17  6:39 Rich Lane
2009-08-17 13:07 ` Andrei Thorp
2009-08-22 14:10   ` William Morgan
2009-08-22 14:10 ` William Morgan
2009-08-22 18:28   ` Rich Lane [this message]

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=1250964897-sup-2990@zyrg.net \
    --to=rlane@club.cc.cmu.edu \
    /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