Re: The Lisp CPU

From: Alex Vinokur (alexvn_at_big-foot.com)
Date: 08/16/04


Date: Mon, 16 Aug 2004 10:26:04 +0300


"rem642b@Yahoo.Com" <RobertMaas@YahooGroups.Com> wrote in message news:REM-2004aug15-005@Yahoo.Com...
[snip]
> But what if there are a whole bunch of such variables? So the sixth one
> still takes a while. In that case you might need to re-write the tight
> loop to access slots in a single structure rather than separate
> variables. So instead of variables x1 x2 x3 x4 x5 x6, you'd have (caar
> xstr) (cdar xstr) (caadr xstr) (caddr xstr) (cdadr xstr) (cdddr xstr),
> where x1 and x2 are very fast and the rest are slightly slower. If you
> know how to build a Huffman code, you can use a similar method to
> optimize the total cost of a set of variables that have known
> (profiled) frequencies of usage.
[snip]

Perhaps, n-ary Huffman Template Algorithm might help to do that:
http://sourceforge.net/projects/huffman-ta/
http://alexvn.freeservers.com/s1/huffman_template_algorithm.html
Note. The algorithm has been written in C++.

-- 
   Alex Vinokur
     http://mathforum.org/library/view/10978.html
     http://sourceforge.net/users/alexvn


Relevant Pages