Re: Updated: fortune-1.99.1-1

2005-01-21 Thread Michael Schaap
Hi Yitzckak,
On 13-Jan-2005 21:27, Yitzchak Scott-Thoennes wrote:
  Achilles:  Don't tell me you believe in fortune-telling!
  Tortoise:  No...but they say it works even if you don't believe in it.
 -- GEB, Hofstadter
I've made a new version of fortune available for installation.
 

Thanks for bracing the storm and doing this!
One thing, though: this version is much, much slower than the previous 
one. It takes around a second to produce a fortune, while the old one 
ran pretty much instantaneously. (This is on a high end XP box.)

When I run strace fortune, the new version produces 16,771 lines of 
output. The old version produces 467 lines...
I won't attach it to this message, for size reasons.

You might think: what's the big deal, a second to run fortune, but I'm 
running fortune from my prompt(*), so I now have to wait up to a second 
for my prompt to appear.

 Michael
(*): This is using zsh. I basically have the following lines in my .zshrc:
# Load color arrays
autoload colors
colors
# Fortune before every prompt
precmd()
{
echo -n \n$fg[blue]
fortune -a -s # but think about the children...
echo -n $reset_color
}
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Updated: fortune-1.99.1-1

2005-01-21 Thread Yitzchak Scott-Thoennes
On Fri, Jan 21, 2005 at 04:49:21PM +0100, Michael Schaap wrote:
 Hi Yitzckak,
 
 On 13-Jan-2005 21:27, Yitzchak Scott-Thoennes wrote:
 
   Achilles:  Don't tell me you believe in fortune-telling!
   Tortoise:  No...but they say it works even if you don't believe in it.
  -- GEB, Hofstadter
 
 I've made a new version of fortune available for installation.
  
 
 Thanks for bracing the storm and doing this!
 
 One thing, though: this version is much, much slower than the previous 
 one. It takes around a second to produce a fortune, while the old one 
 ran pretty much instantaneously. (This is on a high end XP box.)

Is that the first time you run it, or every time?  For me it goes
much faster on subsequent runs, presumably due to disk cache.

 When I run strace fortune, the new version produces 16,771 lines of 
 output. The old version produces 467 lines...
 I won't attach it to this message, for size reasons.

I will actually try it in the next day or so, but I believe this is
due to a bug in the old fortune version where the -a switch was
disregarded and only a single fortune file checked.  Additionally,
the old fortune had fewer fortunes in far fewer files.

Nevertheless, I will see if there's any way to speed up the selection
from any files.

As a workaround, you can cat together the base fortune files (those
without a .dat or .u8 extension), run /usr/bin/strfile on it to create
the .dat file, and create a .u8 symlink to it.  Then run fortune without
the -a switch but with your large file name.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Updated: fortune-1.99.1-1

2005-01-21 Thread Michael Schaap
On 21-Jan-2005 23:59, Yitzchak Scott-Thoennes wrote:
On Fri, Jan 21, 2005 at 04:49:21PM +0100, Michael Schaap wrote:
 

Hi Yitzckak,
On 13-Jan-2005 21:27, Yitzchak Scott-Thoennes wrote:
   

Achilles:  Don't tell me you believe in fortune-telling!
Tortoise:  No...but they say it works even if you don't believe in it.
   -- GEB, Hofstadter
I've made a new version of fortune available for installation.
 

Thanks for bracing the storm and doing this!
One thing, though: this version is much, much slower than the previous 
one. It takes around a second to produce a fortune, while the old one 
ran pretty much instantaneously. (This is on a high end XP box.)
   

Is that the first time you run it, or every time?  For me it goes
much faster on subsequent runs, presumably due to disk cache.
 

Indeed, it is quite a bit faster on subsequent runs (time fortune -a 
initially reports 1.3 seconds, subsequently 0.3 seconds), although it 
'forgets' this quite quicky, after a minute or so it's back to 1.3 already.

When I run strace fortune, the new version produces 16,771 lines of 
output. The old version produces 467 lines...
I won't attach it to this message, for size reasons.
   

I will actually try it in the next day or so, but I believe this is
due to a bug in the old fortune version where the -a switch was
disregarded and only a single fortune file checked.
Hmm, I never noticed. So that's why I didn't get offended. ;-)
 Additionally,
the old fortune had fewer fortunes in far fewer files.
 

I think that's certainly part of the reason. However, that probably 
doesn't explain the whole slowdown: there are now about 35 times as many 
system calls...

By the way, I'm also running fortune-mod version 9708, with almost as 
many fortunes, on a Linux box (with lower specs than my Windows box), 
and there it's running much faster: 0.015s on the first run.
There are no *.u8 symlinks there, by the way. And I tried removing those 
from the Cygwin /usr/share/games/fortunes directory: that actually makes 
it about twice as fast... Are those *.u8 symlinks doing anything useful?

Nevertheless, I will see if there's any way to speed up the selection
from any files.
As a workaround, you can cat together the base fortune files (those
without a .dat or .u8 extension), run /usr/bin/strfile on it to create
the .dat file, and create a .u8 symlink to it.  Then run fortune without
the -a switch but with your large file name.
 

Yeah, that helps quite a bit.
With only two fortune files (one regular, one offensive), and without 
the .u8 symlinks, it runs pretty smoothly: 0.064 seconds.
(For the record: for the offensive fortunes, use strfile -x.)

Thanks,
 Michael
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Updated: fortune-1.99.1-1

2005-01-13 Thread Yitzchak Scott-Thoennes
   Achilles:  Don't tell me you believe in fortune-telling!
   Tortoise:  No...but they say it works even if you don't believe in it.
  -- GEB, Hofstadter

I've made a new version of fortune available for installation.

As of version 1.99.1-1, the fortune database has been reorganized and
recategorized.  See /usr/share/doc/fortune-1.99.1/{cookie-files,Offensive}.

If you happen across offensive fortunes in the supposedly unoffensive
files, report them to cygwin@cygwin.com and they will be moved if
appropriate.  You will get faster response if you also take the time
to file a debian bug report (see README.Debian.offensive in
/usr/share/doc/fortune-1.99.1/debian).  If you want to audit the
fortune files for offensiveness, do *not* report your results to
cygwin@cygwin.com; instead, pester the upstream maintainer (see
canonical homepage above).

All debian version 1.99.1-1 patches to the data files have been
applied (see http://packages.debian.org/unstable/source/fortune-mod),
including spelling changes and removal of a number of German quotes.
(Debian provides several language specific fortune datafile packages
that are as yet not distributed in cygwin.)

Removed use of recode, since the recode library seems to have problems;
instead use fake recode functions using iconv.  The problems with iconv
that led to fortune changing to recode are somewhat mitigated by using
iconv's transliteration option.  This should be a temporary measure.

For a brief description of this package, and a listing of the files it
contains, see http://cygwin.com/packages/ .

To update your installation, click on the Install Cygwin now link on
the http://cygwin.com/ web page.  This downloads setup.exe to your
system.  setup.exe is the utility that cygwin uses to install and
update its packages.

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the List-Unsubscribe:  tag in the email header of this message.
Send email to the address specified there.  It will be in the format:

[EMAIL PROTECTED]

If you need more information on unsubscribing, start reading here:

http://sources.redhat.com/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at the above URL.