[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] Leafnode slow since 1.9.33



Rein Klazes schrieb am 2003-08-25:

> Now working from 1.9.27 up to 1.9.33 I found what is causing the
> slowness. It is this part of the 1.9.33 diff:
> 
> | diff -Nur leafnode-1.9.32.rel/xoverutil.c leafnode-1.9.33.rel/xoverutil.c
> | --- leafnode-1.9.32.rel/xoverutil.c     2003-01-03 03:35:09.000000000 +0100
> | +++ leafnode-1.9.33.rel/xoverutil.c     2003-01-27 04:18:46.000000000 +0100
> | @@ -265,7 +265,10 @@
> |      xfirst = ULONG_MAX;
> |      xlast = 0;
> |      while ((de = readdir(d))) {
> | +       struct stat st;
> |         if (de->d_name[0] == '.') continue; /* skip dot files */
> | +       if (stat(de->d_name, &st) == 0 && !S_ISREG(st.st_mode))
> | +           continue; /* skip directories, e. g. alt.games.simcity.3000 */
> |         art = strtoul(de->d_name, &p, 10);
> |         if (art && p && !*p) {
> |             if (art < xfirst)
> | @@ -341,8 +344,11 @@
> |   
> |      /* so, what was missing? */
> |      while ((de = readdir(d))) {
> | +       struct stat st;
> |         if (de->d_name[0] == '.')
> |             continue;
> | +       if (stat(de->d_name, &st) == 0 && !S_ISREG(st.st_mode))
> | +           continue;
> |         art = strtoul(de->d_name, &p, 10);
> |         if (p && !*p && art >= xfirst && art <= xlast) {
> |             if (!xoverinfo[art - xfirst].text) {
> 
> Reverting it also makes 1.9.42 run fine as before. I'm not subscribed to
> such stupidly named newsgroups, but I realise this brings a bug back
> again.

First of all, thank your for debugging this and tracking it down. I
agree that stat() is a problem performance-wise, and mixing articles and
newsgroups with the same name isn't the right concept. OTOH, leafnode-1
chooses "traditional spool" and this brings us this problem.

As a workaround, I can imagine storing alt.games.simcity.3000 as
$spooldir/alt/games/simcity/-3000. This obviates the need for stat and
can automatically be migrated by texpire at virtually no extra cost
because texpire stats all files anyways.

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list