Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news.ner.bbnplanet.net!howland.reston.ans.net!newsfeed.internetmci.com!in2.uu.net!news.reference.com!cnn.nas.nasa.gov!eos!kronos.arc.nasa.gov!ptolemy.arc.nasa.gov!kpc
From: k p c <kpc@ptolemy.arc.nasa.gov>
Subject: How to speed up DECODE-UNIVERSAL-TIME?  How to save last 4 results?
Message-ID: <1996Feb7.050659.26205@ptolemy-ethernet.arc.nasa.gov>
X-Disclaimer: No organization, company, or government is represented here.
X-Attribution: kpc
Lines: 36
Sender: usenet@ptolemy-ethernet.arc.nasa.gov (usenet@ptolemy.arc.nasa.gov)
Nntp-Posting-Host: phenotype.arc.nasa.gov
Reply-To: kpc@ptolemy.arc.nasa.gov
Cc: kpc@ptolemy.arc.nasa.gov
Organization: NASA Ames Research Ctr, Information Sciences Div and Aero Facil
	Branch.  Disclaimer: neither a civil servant nor a representative.
Date: Wed, 7 Feb 1996 05:14:41 GMT

DECODE-UNIVERSAL-TIME, ENCODE-UNIVERSAL-TIME, and functions like
TRUNCATE called by them use perhaps 75% of an application's CPU time
in Allegro 4.2.

I ran an analysis and found that decode-universal-time is improved by
saving the last set of returned multiple values.  I did this manually
and found an improvement, but it probably needs to have the last 4
sets of results saved.  Not a hash table, but the last 4 only, as it
is called millions of times and I don't want to grow a hash table.

And there's the problem.  What data structure to store 4 sets of
multiple values in?  How exactly to declare it?  What is fastest?

And, in general, how best to speed those two functions up?  I almost
certainly don't want to rewrite my large time arithmetic package to
use a different representation (days since the year 1 or whatever), as
it is quite powerful and trustworthy for my needs and I don't know of
anything else in CL that does anything comparable.  I just want it to
be faster.

I have already tried declaring everything in sight to their possihle
values.  Also, I have sped up ancillary calculations by using number
of seconds since 1995, a fixnum, but there seems to be a sort of
fixnum to bignum contagion that Allegro seems to presume unless you
tell it that all fixnums are always fixnums, and I'm not sure I want
to go into nonportable declarations.  Another salient point is that I
could double the speed of everything by using algorithms that ignore
daylight savings time, but that is not an option, unfortunately.

If you post a followup to this article, I would appreciate a courtesy
verbatim copy by email to help work around potentially unreliable feeds.

---
kpc@ptolemy.arc.nasa.gov.  AI, multidisciplinary neuroethology, info filtering.
The other side of the free speech coin is freedom from fear of listening; what
use if nobody may dare listen?  Privacy, web and net, preserves democracy thus.
