Gnus development mailing list
 help / color / mirror / Atom feed
* shy grouping
@ 2004-01-08  6:05 Katsumi Yamaoka
  2004-01-08 12:29 ` Katsumi Yamaoka
  0 siblings, 1 reply; 2+ messages in thread
From: Katsumi Yamaoka @ 2004-01-08  6:05 UTC (permalink / raw)


Hi,

I recognized using the `shy grouping' makes regexp search work a
bit faster.  Here are benchmarks (I'm using Lars' benchmark.el):

(and (string-match "\\(a\\)\\(b\\)\\(c\\)\\(d\\)\\(e\\)" "abcde")
     (match-data))
 => (0 5 0 1 1 2 2 3 3 4 4 5)

(benchmark 1000
  (string-match "\\(a\\)\\(b\\)\\(c\\)\\(d\\)\\(e\\)" "abcde"))
0.0013788938522338867
0.001417994499206543
0.0013669729232788086
0.0013679265975952148
0.0013790130615234375

(and (string-match "\\(?:a\\)\\(?:b\\)\\(?:c\\)\\(?:d\\)\\(?:e\\)" "abcde")
     (match-data))
 => (0 5)

(benchmark 1000
  (string-match "\\(?:a\\)\\(?:b\\)\\(?:c\\)\\(?:d\\)\\(?:e\\)" "abcde"))
0.0009989738464355469
0.0010300874710083008
0.0009980201721191406
0.0010030269622802734
0.000986933708190918

I am actually using Gnus which modified regexp strings of many,
it doesn't seem to work faster than yesterday, though. ;-)
Therefore, I decided not to install it unless there's a request.

By the way, I found a bug in XEmacs yet again.  The `shy
grouping' cannot be used in some case as follows:

(string-match "\\(?:^\\|:\\)foo" "foo")
 => nil

It is just applied to `gnus-group-charset-alist'.  Please
remember this, when you need to use the `shy grouping'.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

* Re: shy grouping
  2004-01-08  6:05 shy grouping Katsumi Yamaoka
@ 2004-01-08 12:29 ` Katsumi Yamaoka
  0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2004-01-08 12:29 UTC (permalink / raw)


BTW, I found strange things while scanning all regexp strings
in Gnus.  Please ignore this message supposing they are under
development.

nnwarchive.el: nnwarchive-egroups-list

The regexp string contains only one subexpression.

    (while
	(re-search-forward "href=\"/group/\\([^/\"\> ]+\\)" nil t)
      (setq group (match-string 1)
	    description (match-string 2))

nnweb.el: nnweb-gmane-wash-article

Same as above.

    (while (looking-at "^<li><em>\\([^ ]+\\)</em>.*</li>")
      (replace-match "\\1\\2" t)

pgg-parse.el: pgg-armor-header-lines

It seems unused.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

end of thread, other threads:[~2004-01-08 12:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-08  6:05 shy grouping Katsumi Yamaoka
2004-01-08 12:29 ` Katsumi Yamaoka

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).