Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Speed, Faster... Faster... Slower?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 35 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tony  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Tony <tonyNOtoS...@chice.force9.co.uk.invalid>
Date: 2000/01/18
Subject: Speed, Faster... Faster... Slower?
I use lisp largley to write code for evloving Neural
Networks which can be a very time consuming task. I'm
currently running Alegro LISP in a Win 95 environment, and
my programs take days (sometimes weeks) to run. Is there any
way to speed things up a bit?

Oh, and does anyone know whether Alegro LISP would work
under Linux or would I need a different version?

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marco Antoniotti  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Marco Antoniotti <marc...@parades.rm.cnr.it>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?

Tony <tonyNOtoS...@chice.force9.co.uk.invalid> writes:
> I use lisp largley to write code for evloving Neural
> Networks which can be a very time consuming task. I'm
> currently running Alegro LISP in a Win 95 environment, and
> my programs take days (sometimes weeks) to run. Is there any
> way to speed things up a bit?

Maybe by using better data structures and algorithms? :}

Cheers

--
Marco Antoniotti ===========================================
PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
tel. +39 - 06 68 10 03 17, fax. +39 - 06 68 80 79 26
http://www.parades.rm.cnr.it/~marcoxa


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arvid Grøtting  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Arvid Grøtting <arv...@pc-arvidg.infotek.no>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?
* Marco Antoniotti

> Tony <tonyNOtoS...@chice.force9.co.uk.invalid> writes:

> > I use lisp largley to write code for evloving Neural
> > Networks which can be a very time consuming task. I'm
> > currently running Alegro LISP in a Win 95 environment, and
> > my programs take days (sometimes weeks) to run. Is there any
> > way to speed things up a bit?

> Maybe by using better data structures and algorithms? :}

:-)

One problem with neural networks is that they're inherenly both
massively parallel and quite analog.  Doing them efficiently on a
mostly-sequential, definitely-digital computer can be a pain, even
where possible.

Then again, analog VLSI, while efficient for these computations, has
quite a long develop-compile-test cycle :-)

--
Arvid

colonel Uzi Semtex security ammunition arrangements Waco, Texas CIA


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marco Antoniotti  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Marco Antoniotti <marc...@parades.rm.cnr.it>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?

Of course.  But then again, what are the main data strutcures you are
using?

Cheers

--
Marco Antoniotti ===========================================
PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
tel. +39 - 06 68 10 03 17, fax. +39 - 06 68 80 79 26
http://www.parades.rm.cnr.it/~marcoxa


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Tony <TonyNOToS...@chice.force9.co.uk.invalid>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?
The networks are stored as lists containing structures
defining the connections, my algorithms are probably not
perfect (with regards to optomising speed) the real problem
lies with LISP itself, If I define a simple algorithm in say
C for example, and run them back to back, the C program will
on average take about half the time the LISP one needs to
run. I'm currently just running from the editor into
toploop, but was hoping that the file could be compiled into
an .exe or something to speed it up.
With regards to my data structures, a reccurent network of
10 nodes, with an average connectivity of say 5, evolving
with a population of about 30 using a SAGA style GA for
about 100,000 generations, meas that the node summing
section allone has been executed 150,000,000 times Thus it
takes ages.

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Monfera  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Robert Monfera <monf...@fisec.com>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?

Tony wrote:
> The networks are stored as lists containing structures
> defining the connections,

Consider using arrays and declarations (there are lots of examples if
you watch this newsgroup).

> I'm currently just running from the editor into
> toploop, but was hoping that the file could be compiled into
> an .exe or something to speed it up.

You could compile your function:

> (defun foo ...)
> (compile 'foo)
> (time (foo ...))

If you show parts of the code, you will more likely get specific
suggestions about data structures and declarations.

Regards
Robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Watton  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: John Watton <john.wat...@alcoa.com>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?
In article <18dae34d.4d4aa...@usw-ex0110-076.remarq.com>,
  Tony <tonyNOtoS...@chice.force9.co.uk.invalid> wrote:

> I use lisp largley to write code for evloving Neural
> Networks which can be a very time consuming task. I'm
> currently running Alegro LISP in a Win 95 environment, and
> my programs take days (sometimes weeks) to run. Is there any
> way to speed things up a bit?

If you have ACL 4.3 or greater then you should try profiling to
determine where your bottlenecks are. See:

http://www.franz.com/support/docs/5.0/doc/cl/profiling.htm

Once you know where the bottlenecks are then you can attack with
optimizations to the algorithms and/or declarations.

> Oh, and does anyone know whether Alegro LISP would work
> under Linux or would I need a different version?

You will need a different version. See www.franz.com.

--
John Watton
Alcoa Inc.

Sent via Deja.com http://www.deja.com/
Before you buy.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Tony <TonyNOToS...@chice.force9.co.uk.invalid>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?
Some of the data is contained in simple-vectors, other bits
in arrays, within the structures, but the use of arrays is
wastefull in this situation as the ultimate size is unknown.

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruce Tobin  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Bruce Tobin <bto...@columbus.rr.com>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?

Tony wrote:

> If I define a simple algorithm in say
> C for example, and run them back to back, the C program will
> on average take about half the time the LISP one needs to
> run.

Well, that's about right, or it was the last time I ran similar tests.
You can (or could, at that time) get a 100% speedup by going to
ACL/Linux, at which point you'll be slightly faster than a g++
implementation of a lispy algorithm, but maybe not as fast as a gcc
implementation of same.  Shouldn't be a lot of difference, though.

> I'm currently just running from the editor into
> toploop, but was hoping that the file could be compiled into
> an .exe or something to speed it up.

Well, if you're not compiling before you run, you could see a dramatic
speedup by compiling.  However, I wouldn't expect you to benchmark as
well against a C implementation if you weren't compiling somehow.  What
version of Allegro are you using?  ACL 3.x compiles automatically, but
it doesn't optimize as well as more recent versions.  If that's what
you're using you should switch to something newer, and then make sure
you compile.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?
* Tony <TonyNOToS...@chice.force9.co.uk.invalid>
| Some of the data is contained in simple-vectors, other bits
| in arrays, within the structures, but the use of arrays is
| wastefull in this situation as the ultimate size is unknown.

  well, you _could_ use adjustable vectors with fill pointers if such is
  your concern.  Common Lisp knows that the tradeoff that people made with
  lists carried a performance penalty.  look at VECTOR-PUSH and VECTOR-POP
  for ways to deal with unknown sizes and still get O(1) access times.

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Noah Kleiman  
View profile  
 More options Jan 18 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Noah Kleiman <modn...@cats.ucsc.edu>
Date: 2000/01/18
Subject: Re: Speed, Faster... Faster... Slower?
You can get ACL lite for linux free from franz ...
and it works.. i've been using it...

have you compiled your funtions ? if you don't it really slows things down...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marco Antoniotti  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Marco Antoniotti <marc...@parades.rm.cnr.it>
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?

Tony <TonyNOToS...@chice.force9.co.uk.invalid> writes:
> The networks are stored as lists containing structures
> defining the connections,

How many connections?  Do you always run through all the connections
(DOLIST) or do you occasionally need to access the i-th connection to
do something with it?

> my algorithms are probably not
> perfect (with regards to optomising speed) the real problem
> lies with LISP itself, If I define a simple algorithm in say
> C for example, and run them back to back, the C program will
> on average take about half the time the LISP one needs to
> run.

Do you use 'lists' in C as well?  Or do you 'malloc' an array to
represent your connections?

> I'm currently just running from the editor into
> toploop, but was hoping that the file could be compiled into
> an .exe or something to speed it up.
> With regards to my data structures, a reccurent network of
> 10 nodes, with an average connectivity of say 5, evolving
> with a population of about 30 using a SAGA style GA for
> about 100,000 generations, meas that the node summing
> section allone has been executed 150,000,000 times Thus it
> takes ages.

Apologies, but this does not mean much to me.  Not being a NN expert I
can only surmise the graph structure of the net, but not much beyond
it.  If you posted some code, the newsgroup could be more helpful.

Cheers

--
Marco Antoniotti ===========================================
PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
tel. +39 - 06 68 10 03 17, fax. +39 - 06 68 80 79 26
http://www.parades.rm.cnr.it/~marcoxa


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Posey  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Robert Posey <mu...@raytheon.com>
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?

You can do lists fine in STL if you go to C++, and they support
inserts, deletion and searches fairly well.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chuck Fry  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: chu...@best.com (Chuck Fry)
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?
In article <3885D4F7.3D3C6...@raytheon.com>,
Robert Posey  <mu...@raytheon.com> wrote:

>Marco Antoniotti wrote:
>> Do you use 'lists' in C as well?  Or do you 'malloc' an array to
>> represent your connections?

>You can do lists fine in STL if you go to C++, and they support
>inserts, deletion and searches fairly well.

If memory serves, STL's lists are doubly-linked.  They're also a pain in
the *ss to use with heterogeneous data.

 -- Chuck
--
            Chuck Fry -- Jack of all trades, master of none
 chu...@chucko.com (text only please)  chuck...@home.com (MIME enabled)
Lisp bigot, car nut, photographer, sometime guitarist and mountain biker
The addresses above are real.  All spammers will be reported to their ISPs.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Tony <tonyNOtoS...@chice.force9.co.uk.invalid>
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?
I've just put up some LISP code for a Dynamic Reccurent
Neural Net, so you can see how my data structures work.
My code is probably horrible to look at, but I've semi
documented it so it shouldn't be to bad. Anyway Let me know
if you think it can be speeded up at all?
Also if you think it can be improved.
Anyway it's all on my home page at... www.chice.force9.co.uk

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marco Antoniotti  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Marco Antoniotti <marc...@parades.rm.cnr.it>
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?

Why go C++/STL when you can have the real thing? :)

Apart from that, one of the most common pifalls of Lisp vs C
comparisons is that the data structures used in C are different from
those used in Lisp.  If I use a 'malloc-ed' array in C, I am bound to
get better performance than a list in Lisp, especially if you access
the i-th element out of an ordered traversal.

I bet that using lists with C++/STL would result in larger code and
slower as well w.r.t. an equivalent C/C++ array based implementation
(not to speak of any comparison with Lisp).

Cheers

--
Marco Antoniotti ===========================================
PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
tel. +39 - 06 68 10 03 17, fax. +39 - 06 68 80 79 26
http://www.parades.rm.cnr.it/~marcoxa


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?

* Tony  wrote:
> I've just put up some LISP code for a Dynamic Reccurent
> Neural Net, so you can see how my data structures work.

Here's a rewrite of the start of it.  It uses arrays pervasively, and
doesn't have global variables but rather passes the activity array in
to various functions.  I gave up slightly before the end as I ran out
of time.

CMUCL should run this kind of code really well (albeit I haven't even
tried compiling it other than the Y function so it might be buggy and
/ or need better declarations.

;; Code for a list based Reccurent Neural Network
;; We will need a global list of length = no_of_nodes, which gives the current activation levels of
;; every node in the network. This list will be updated and accessed by future functions.

;(defun setup_activity (no_of_nodes)
;   (setf *structure* nil)
;   (setf *structure* (cons 1 (dotimes (x no_of_nodes *structure*)
;                              (setf *structure* (cons '0 *structure*))))))

(defun make-activity (n)
  (let ((a (make-array n
                       :element-type 'single-float
                       :initial-element 0.0s0)))
    (setf (aref a 0) 1.0s0)
    a))

;;(setup_activity 10)
;;>(1 0 0 0 0 0 0 0 0 0 0)
;;(setup_activity 20)
;;>(1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)

;; Starting with the functions to create a single neurone/node
;; I need a to create a structure to hold the weights and any other information about the node.

;(defstruct node
;  weights_list  ;a list of weights, including the bias weight
;  input_list)   ;a list of input locations pointing to positions in *structure* including the bias node

(defstruct (node
            (:constructor %make-node))
  weights-array
  input-array)

(defun make-node (weights-list input-list)
  (%make-node :weights-array (make-array (length weights-list)
                                         :element-type 'single-float
                                         :initial-contents weights-list)
              :input-array (make-array (length input-list)
                                       :element-type 'fixnum
                                       :initial-contents input-list)))

;(defun mk_node_struct (weights_list input_list)
;   (setf *node* (make-node
;                  :weights_list weights_list
;                  :input_list input_list)))

;; I now need to crate a set of functions to calculate the output of the neurone.
;; function a takes the weights and the input and sums w1*i1+..+wn*in
;; returning the value of a for the given node.

;(defun a (weights_list input_list)
;   (cond ((not (equal (length weights_list)(length input_list))) 'error)
;         ((null weights_list) 0)
;         (t (+ (a (cdr weights_list)(cdr input_list))
;              (* (car weights_list)(nth (car input_list) *structure*))))))

(defun a (node activity)
  (declare (type node node)
           (type (simple-array single-float (*)) activity))
  (let ((wa (node-weights-array node))
        (ia (node-input-array node))
        (sum 0.0s0))
    (declare (type (simple-array single-float (*)) wa)
             (type (simple-array fixnum (*)) ia)
             (type single-float sum))
    (when (not (= (length wa) (length ia)))
      (error "incompatible thingies"))
    (dotimes (i (length wa) sum)
      (declare (type fixnum i))
      (setf sum (+ sum
                   (* (aref wa i)
                      (aref activity (aref ia i))))))))

;;(a '(1 2 3) '(0 1 5))
;;>1

;; Now we need a sygmoid function to work out y given a as input

;(defun y (a)
;  (/ 1 (+ (exp (- a)) 1)))

(declaim (inline y))

(defun y (a)
  ;; I can't get allegro to compile this well (but I haven't tried
  ;; very hard). CMUCL does really well.
  (declare (type single-float a))
  (/ 1.0s0 (+ (exp (- a)) 1.0s0)))

;;(y 0)
;;> 0.5
;;(y 1)
;;> 0.73105...
;;(y -0.7)
;;> 0.331812227831834

;; Now we need a function that will take the current *node* structure and return y

;(defun Run_node ()
;  (y (a (node-weights_list *node*)(node-input_list *node*))))

(declaim (inline run-node))

(defun run-node (node activity)
  (declare (type node node)
           (type (simple-array single-float (*)) activity))
  (y (a node activity)))

;;(mk_node_struct '(2 3 6 -3) '(0 1 2 3))
;;>#S(NODE WEIGHTS_LIST (2 3 6 -3) INPUT_LIST (0 1 2 3))
;;(run_node)

;;> 0.880797077977882

;; Right, now that we have functions to work out the output of a given node, we now need to update
;; the *structure* with this new output value, and go through for each node

;(defun full_pass (node_struct_list)
;   (cond ((null node_struct_list) *structure*)
;         (t (dotimes (x (length node_struct_list) *structure*)
;               (setf *node* (nth x node_struct_list))
;             (setf (nth (+ x 1) *structure*)(run_node))))))

(defun full-pass (node-list activity)
  (declare (type (simple-array fixnum (*)) activity))
  (loop for i of-type fixnum upfrom 0
      for n of-type node in node-list
      do
        (setf (aref activity i) (run-node n activity))))

;;; ... ran out of time ...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raymond Toy  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Raymond Toy <t...@rtp.ericsson.se>
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?

>>>>> "Tim" == Tim Bradshaw <t...@cley.com> writes:

    Tim> (defun make-activity (n)
    Tim>   (let ((a (make-array n
    Tim>                    :element-type 'single-float
    Tim>                    :initial-element 0.0s0)))
    Tim>     (setf (aref a 0) 1.0s0)
    Tim>     a))

[snip]
    Tim> (defun y (a)
    Tim>   ;; I can't get allegro to compile this well (but I haven't tried
    Tim>   ;; very hard). CMUCL does really well.
    Tim>   (declare (type single-float a))
    Tim>   (/ 1.0s0 (+ (exp (- a)) 1.0s0)))

A common typo:  1.0s0 is a short-float, not a single-float.  This
doesn't matter to CMUCL since short-float and single-float are the
same, but it might matter to others.

Ray


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Wette  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Matt Wette <Matthew.R.We...@jpl.nasa.gov>
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?

Marco Antoniotti <marc...@parades.rm.cnr.it> writes:
> Why go C++/STL when you can have the real thing? :)

> Apart from that, one of the most common pifalls of Lisp vs C
> comparisons is that the data structures used in C are different from
> those used in Lisp.  If I use a 'malloc-ed' array in C, I am bound to
> get better performance than a list in Lisp, especially if you access
> the i-th element out of an ordered traversal.

> I bet that using lists with C++/STL would result in larger code and
> slower as well w.r.t. an equivalent C/C++ array based implementation
> (not to speak of any comparison with Lisp).

Not sure I buy that one.  In C++/STL you can build a linked list
structure where the data is part of the cell:
   -----------------------------------------      -------
  | data | more data | and so forth | next* | -> | data ...
   -----------------------------------------      -------

In LISP, my understanding is that lists are held together with cons
cells:

   ---------------      ---------------
  | data* | next* | -> | data* | next* |
   ---------------      ---------------
      |  
   ---------------------------------
  | data | more data | and so forth |
   ---------------------------------

So once you get your hands on the list cell in C++ you have the data.
In LISP you have one more pointer deference to do.

Can you tell me your rationale for the LISP speedup?

Matt
--
Matthew.R.Wette at jpl.nasa.gov -- I speak for myself, not for JPL.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?

* Raymond Toy wrote:
> A common typo:  1.0s0 is a short-float, not a single-float.  This
> doesn't matter to CMUCL since short-float and single-float are the
> same, but it might matter to others.

Are there any common platforms where short and single floats are
different?  (I'm not trying to deny it was a mistake, I can never
remember what the syntax for a short-float is though...)

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raymond Toy  
View profile  
 More options Jan 19 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Raymond Toy <t...@rtp.ericsson.se>
Date: 2000/01/19
Subject: Re: Speed, Faster... Faster... Slower?

>>>>> "Tim" == Tim Bradshaw <t...@cley.com> writes:

    Tim> * Raymond Toy wrote:
    >> A common typo:  1.0s0 is a short-float, not a single-float.  This
    >> doesn't matter to CMUCL since short-float and single-float are the
    >> same, but it might matter to others.

    Tim> Are there any common platforms where short and single floats are
    Tim> different?  (I'm not trying to deny it was a mistake, I can never
    Tim> remember what the syntax for a short-float is though...)

Likewise.

CLISP does:

[1]> (float-digits 1s0)
17
[2]> (float-digits 1f0)
24

Don't know of any others.

Ray


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
R. Matthew Emerson  
View profile  
 More options Jan 20 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: r...@nightfly.apk.net (R. Matthew Emerson)
Date: 2000/01/20
Subject: Re: Speed, Faster... Faster... Slower?

Tim Bradshaw <t...@cley.com> writes:
> * Raymond Toy wrote:

> > A common typo:  1.0s0 is a short-float, not a single-float.  This
> > doesn't matter to CMUCL since short-float and single-float are the
> > same, but it might matter to others.

> Are there any common platforms where short and single floats are
> different?  (I'm not trying to deny it was a mistake, I can never
> remember what the syntax for a short-float is though...)

[I posted this from work already, but it looks like it didn't make it out.]

In Macintosh Common Lisp, as of version 4.1, a short-float is an
IEEE single precision quantity (32 bits).  The rest of the float
types (single-float, double-float, long-float) are IEEE double
precision.

-matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raymond Wiker  
View profile  
 More options Jan 20 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Raymond Wiker <raym...@orion.no>
Date: 2000/01/20
Subject: Re: Speed, Faster... Faster... Slower?

        Hum. This is only the case when the data type is primitive or
has a copy constructor, and that means that you'll end up copying the
data value(s) into the list, and possibly also when doing a read
access. In some cases you may want to use a list of pointers instead,
in which case you end up with a similar list structure to what LISP
uses...

        So, the speedup for LISP is actually quite plausible.

        //Raymond.

--
Raymond Wiker, Orion Systems AS
+47 370 61150


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Corman  
View profile  
 More options Jan 20 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: ro...@xippix.com (Roger Corman)
Date: 2000/01/20
Subject: Re: Speed, Faster... Faster... Slower?
On 19 Jan 2000 22:52:20 +0000, Tim Bradshaw <t...@cley.com> wrote:

>* Raymond Toy wrote:

>> A common typo:  1.0s0 is a short-float, not a single-float.  This
>> doesn't matter to CMUCL since short-float and single-float are the
>> same, but it might matter to others.

>Are there any common platforms where short and single floats are
>different?  (I'm not trying to deny it was a mistake, I can never
>remember what the syntax for a short-float is though...)

In Corman Lisp (1.3 and later), a short float fits into a tagged word,
like a fixnum, and is 30 bits. A single float is an IEEE 32-bit float.
A double-float is IEEE 64-bits. Of course the short float is efficient
to pass and store (no boxing) but the math operators all convert it
to/from 32-bits for operations. It basically just rounds off the last
two bits of the mantissa to get from 32-bits to 30.

Roger Corman


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Corman  
View profile  
 More options Jan 20 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: ro...@xippix.com (Roger Corman)
Date: 2000/01/20
Subject: Re: Speed, Faster... Faster... Slower?
On 19 Jan 2000 13:25:11 -0800, Matt Wette

<Matthew.R.We...@jpl.nasa.gov> wrote:
>So once you get your hands on the list cell in C++ you have the data.
>In LISP you have one more pointer deference to do.

>Can you tell me your rationale for the LISP speedup?

Well, if the data is a fixnum or something else small it will be
stored in the cell, not a pointer (for many versions of lisp).
Also, you can certainly link structs together in Lisp, which does just
what you are doing in C++ (stores data and pointer in the same heap
object).

Hoever, I don't think the issue of a pointer dereference is worth
thinking about. In my experience Lisp is much faster than C++ for list
management for several reasons.

Memory management: lisp systems are optimized to allocate small pieces
for lists, unlike "new" or "malloc" which are usually far slower than
CONS. Also, CONS will often be inlined, even further speeding things
up. (I have never seen new or malloc inlined in C or C++).
A good garbage collector should be able to free large numbers of list
elements much faster than calling free() on each one explicitly.

Because lisp is designed and optimized for list processing, operations
which traverse and alter list structures tend to be highly optimized
and inlined. Many standard lisp benchmarks stress these operations,
and compiler vendors have responded by using every possible trick to
make lists as fast as possible.

Of course in C++ you could write your own memory management functions,
and write your own macros for handling lists, and approach the
efficiency of lisp if you spend enough time on it. I think of this as
basically the "I can build Lisp in C++, therefore C++ can do anything
Lisp can do" argument.

Well, I could write a C++ compiler in Lisp...  :-)

Roger Corman


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 35   Newer >
« Back to Discussions « Newer topic     Older topic »