Gnus development mailing list
 help / color / mirror / Atom feed
From: Hrvoje Niksic <hniksic@srce.hr>
Subject: Re: timezone.el patterns in emacs 19.34
Date: 04 May 1997 02:41:41 +0200	[thread overview]
Message-ID: <kigvi50jcfu.fsf@jagor.srce.hr> (raw)
In-Reply-To: Ken Raeburn's message of 03 May 1997 19:44:25 -0400

Ken Raeburn <raeburn@cygnus.com> writes:

> Okay, so how would you get around the requirement of matching a
> substring, without using regexps?

Simply make as many routines as there are formats.  For example, if
the format is

   Wkd, blah blah

then I search for week days, if I find them, look for `,', etc.  It's
tedious, but I can guarantee that it would be *much* faster than the
current, Lisp code.

> If you can do it, and get much better performance than we've got now
> with the lisp code, great.  But as I just indicated in other mail,
> my trivial little patch already addresses the performance issue to
> some degree.  So you'll have to do even better. :-)

I certainly won't do it before I get the exact numbers of how much
time is spent in timezone.el, before and after your patch.  It is too
much work to speed up Summary buffer building by 5% or so.

> And, by the way, if you do go ahead with this, I'd suggest returning
> numbers instead of strings when practical.  They can be turned into
> strings easily enough in lisp, and the gnus-dd-mmm usage just converts
> them back to numbers and discards the strings, which means more
> needless garbage to collect.  (Don't underestimate the cost of garbage
> collection.  I've managed to speed up some code by tweaking it to
> allocate less short-term heap storage.)

Yup.

> > NO!  I hate getdate.y.  First, because of the `.y' thingie. :-)
> 
> Aside from the substring issue, I think a parser would be well suited
> to this task.  I see two advantages to it:
>  * Tokenizes first, then looks for patterns in the tokens; this means
>    any backtracking doesn't have to re-process every character.
>  * Yacc sets up a FSM for matching multiple sequences in parallel (as
>    do the more sophisticated regexp matchers), so if a match is going
>    to be made, it'll be made in one pass; the hairy work is done at
>    build time.

But it's huge, and we don't need all that cruft.  In a C
implementation of timezone.el, it would make little difference whether
the parser is "intelligent" or not.

> > Then, there are copyright problems with it.
> 
> No, there aren't.

Yes, there are.  The public domain code is not to be introduced in
important parts of Emacs, as it is compromisable.

> > And, I'd like to have a fast routine that matches those 7 or so
> > format strings.
> 
> Yes, that's the problem I see with it -- it'll handle more than we
> want.

`getdate.y' would handle even more.

> A date header saying "+23hours" is bogus, and should be treated
> as such.  Though if getdate.y matches more "real" date formats than
> timezone-parse-date, I don't think it would be a bad idea to support
> them as well, since this is timezone-parse-date we're talking about,
> and not gnus-parse-conforming-date-header.

If I ever rewrite `timezone-parse-date', it will recognize the dates
it recognizes now.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Good pings come in small packets.


  reply	other threads:[~1997-05-04  0:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199705020844.EAA06520@kr-laptop.cygnus.com>
1997-05-03  1:14 ` Hrvoje Niksic
1997-05-03  3:07   ` Ken Raeburn
1997-05-03  4:04     ` Hrvoje Niksic
1997-05-03 23:44       ` Ken Raeburn
1997-05-04  0:41         ` Hrvoje Niksic [this message]
1997-05-04  3:03           ` Ken Raeburn
1997-05-04 19:55             ` Hrvoje Niksic
1997-05-04 20:49               ` Johan Danielsson
1997-05-04 20:55                 ` Hrvoje Niksic
1997-05-04 22:22                   ` Public domain (was: timezone.el patterns in emacs 19.34) Johan Danielsson
1997-05-05  6:52                     ` Lars Magne Ingebrigtsen
1997-05-04 22:55                   ` timezone.el patterns in emacs 19.34 Stainless Steel Rat
1997-05-08 12:37         ` Lars Magne Ingebrigtsen
1997-05-03 22:41   ` Ken Raeburn
1997-05-02 23:18 Ken Raeburn

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=kigvi50jcfu.fsf@jagor.srce.hr \
    --to=hniksic@srce.hr \
    /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;
as well as URLs for NNTP newsgroup(s).