Message from discussion
the evil of continuations
From: Eliot Miranda <eli...@pacbell.net>
Subject: Re: the evil of continuations
Date: 2000/06/24
Message-ID: <395523D7.48C219E@pacbell.net>#1/1
X-Deja-AN: 638552040
Content-Transfer-Encoding: 7bit
References: <3949E0DC.8E428904@eurocontrol.fr> <3dmdy739.fsf@alum.mit.edu> <4Pu25.84$4p1.1925@burlma1-snr2> <394A7C71.F1F75FE7@acm.org> <ln05wha8.fsf@alum.mit.edu> <394A860B.360DFBE@acm.org> <d7lhwcv5.fsf@alum.mit.edu> <ey3ln04335t.fsf@cley.com> <871z1wqqzz.fsf@orion.dent.isdn.cs.tu-berlin.de> <y9l8zw2szb1.fsf@informatik.uni-tuebingen.de> <8ipt1q$2umv$1@counter.bik-gmbh.de> <y9lwvjjqvn7.fsf@informatik.uni-tuebingen.de> <w4o66r3kran.fsf@lovecraft.irtnog.org> <u03dm6a1y7.fsf@hana.kurims.kyoto-u.ac.jp> <p2tya3x3kvr.fsf@ruebe.zrz.tu-berlin.de> <y9lzoodlswn.fsf@informatik.uni-tuebingen.de> <q6em5ov2vz.fsf@trex.IRO.UMontreal.CA> <395410BC.1B92844@pacbell.net> <q67lbfvml5.fsf@trex.IRO.UMontreal.CA>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@pacbell.net
X-Trace: news.pacbell.net 961881048 63.200.49.199 (Sat, 24 Jun 2000 14:10:48 PDT)
Organization: SBC Internet Services
MIME-Version: 1.0
NNTP-Posting-Date: Sat, 24 Jun 2000 14:10:48 PDT
Newsgroups: comp.lang.scheme
Marc Feeley wrote:
>
> Eliot Miranda wrote:
>
> > Here's the results for VisualWorks 5i.2, a Smalltalk-80 system on a 400
> > MHz Pentium II MMX
> >
> > tfib1 = 610 in 0.066 (using Promise)
> >
> > tfib2 = 610 in 0.037 (using hand-coded join)
> >
> > tfib3 = 610 in 0.045 (using a quickly hacked-up JoinableProcess & join)
>
> This is interesting, but is the time for one iteration or 100 (as in
> my benchmark)?
Oops! Just one. I missed the x100! I'll redo them. But the other
important factor is that they're "green" threads. Which of your
benchmarks are green? I know LinuxThreads are native. There are
dialects of Smalltalk that fully supports true threads (Smalltalk-MT,
QKS Smalltalk) but VisualWorks isn't one of them.
OK, here are the x100 results
| s n |
s := String new writeStream.
s cr.
n := 14.
#(tfib2 tfib3 tfib1) do:
[:functionName| | milliseconds result |
milliseconds := Time millisecondsToRun:
[100 timesRepeat:
[result := n perform: functionName]].
s cr;
nextPutAll: functionName;
nextPutAll: ' = ';
print: result;
nextPutAll: ' in ';
print: milliseconds / 1000.0; cr].
s contents'
tfib2 = 610 in 4.781 (hand-coded join)
tfib3 = 610 in 6.192 (join via JoinableProcess)
tfib1 = 610 in 7.636 (Promise, speed problems because of huge GC
overhead, allocates 70 meg!)
'
> I can't see a loop in you code (but my Smalltalk is a
> little rusty). This would bring the run time between 3.7 and 6.6
> seconds which is roughly a factor of 10 slower than with Gambit-C's
> threads, right?
Well, we need to scale for relative processor performance, but within a
factor of 2, yes. What platform are you running on? If Linux or
Windows then I can run your code here or send you a pointer to
VisualWorks 5i non-commercial for you to run there.
| Also, do any of these variants of threads support
> priorities and real-time scheduling?
VisualWorks, and all Smalltalk-80 derived Smalltalks including Squeak,
have multiple priorities and a real-time scheduler. VisualWorks
actually lets you set the number of priorities dynamically.
--
_______________,,,^..^,,,____________________________
Eliot Miranda Smalltalk - Scene not herd