Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!cs.utexas.edu!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!sdd.hp.com!elroy.jpl.nasa.gov!jato!csi!sam
From: sam@csi.jpl.nasa.gov (Sam Sirlin)
Subject: Re: explicit <-> tacit, space/time usage on prime numbers
Message-ID: <1992Nov4.193352.13350@csi.jpl.nasa.gov>
Originator: sam@kalessin
Sender: usenet@csi.jpl.nasa.gov (Network Noise Transfer Service)
Nntp-Posting-Host: kalessin
Organization: Jet Propulsion Laboratory, Pasadena, CA
References:  <1cr4ajINNngp@nestroy.wu-wien.ac.at>
Date: Wed, 4 Nov 1992 19:33:52 GMT
Lines: 40


In article <1cr4ajINNngp@nestroy.wu-wien.ac.at>, mitloehn@exaib.wu-wien.ac.at (Johann Mitloehner ) writes:
|> Here are some experiments (by T. Kolarik and myself) with the
|> well-known primes-idiom on several machines, comparing tacit and
|> explicit definition of the verb:
|>  
|> On an HP 9000/720 (HP-UX):
|> 
|> J 4.1   Copyright (c) 1990-1992, Iverson Software Inc.  All Rights Reserved.
|> 
|>    0!:2 <'ta-ex.js'
|>    eprimes =. '(i.y.)#~2=+/0=|/~i.y.':'' NB. explicit def
|>    tprimes =.  (=&2 @  (+/ @ (=&0 @ |/~ @ i.))) # i. NB. tacit def
|>    time =. 6!:2
|>    space =. 7!:2
|>    ts =. (time, space)
|>    ts 'tprimes 100'
|> 2.71 2528
|>    ts 'eprimes 100'
|> 0.15 464
...
|> Result: explicit definition is much faster.

Using J6 on a sun sparcstation 1:
  ts 'tprimes 100'
4.53315 24
   ts 'eprimes 100'
0.099996 24
   ts 'eprimes 100'
0.116662 24

   teprimes=. '(i.y.)#~2=+/0=|/~i.y.' : 11   NB. tacitize eprimes
   ts 'teprimes 100'
0.116662 24
   
So not all tacit definitions are equal.
-- 
Sam Sirlin
Jet Propulsion Laboratory         sam@kalessin.jpl.nasa.gov

