Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Oct 1995 15:23:40 -0700
From:      David Greenman <davidg@Root.COM>
To:        "Justin T. Gibbs" <gibbs@freefall.freebsd.org>
Cc:        Olof Johansson <offe@dawnrazor.campus.luth.se>, hackers@freebsd.org
Subject:   Re: wtmp efficiency 
Message-ID:  <199510162223.PAA15796@corbin.Root.COM>
In-Reply-To: Your message of "Mon, 16 Oct 95 15:13:23 PDT." <199510162213.PAA19607@aslan.cdrom.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>>I've found (and fixed) the problem.
>>
>>It's the fact that ftp and uucp connections get 'ftp' or 'uucp' + pid as 
>>tty_line in wtmp. The pid isn't removed when looking up the tty, so the list 
>>gets bigger and bigger.
>>For 'ftp-only' wtmp files the time for parsing the file is proportional to 
>>n^2, where n is the number of entries in the file...
>>(I have an exam on data structures and algorithms next week *grin*).
>
>Well you've put a finger on the problem, but your patch breaks last for
>"last ftp" or "last uucp".
>
>A better solution is to only add entries to the tty list that match our
>interest, and to remove entries from the tty list once we find the matching
>login time.  Since the tty records are small, bcopying the next record
>over the matched record and freeing the next record should make the removal
>easy.  Care to do the honors?

   Actually, I'm writing this change right now, and will post the changes when
I'm finished... There are some other optimizations I'm making at the same time.

-DG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510162223.PAA15796>