From: Eli Barzilay on 14 Mar 2010 15:24 Nicolas Neuss <lastname(a)kit.edu> writes: > Eli Barzilay <eli(a)barzilay.org> writes: > >> Nicolas Neuss <lastname(a)kit.edu> writes: >> >> I've put the code at http://tmp.barzilay.org/x (but again, this was >> just a quick translation). You don't need to compile, just save >> that somewhere and run `mzscheme the-file'. > > OK, doing that I see that it produces the correct result. But I > observe a time of 113 seconds and not 19 seconds (SBCL/optimized: 15 > seconds). My guess is that you're using a 32-bit machine. MzScheme (like many other Lisps and Schemes) uses 1 bit to distinguish fixnums from other values -- so code that does a lot of 32-bit arithmetics gets a huge penalty in the form of allocating each such number. (Or maybe you're using an old version?) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life!
From: Eli Barzilay on 14 Mar 2010 15:34 Slobodan Blazeski <slobodan.blazeski(a)gmail.com> writes: > On Mar 13, 11:27 pm, Eli Barzilay <e...(a)barzilay.org> wrote: >> Hugh Aguilar <hughaguila...(a)yahoo.com> writes: >> > On Mar 12, 6:33 pm, Helmut Eller <eller.hel...(a)gmail.com> wrote: >> >> The text was "abcdefghijklmnopqrstuvwxyz". >> >> > This file is too short. >> >> (FWIW, I tried to have a quick and naive translation of the CL code to >> PLT, and on a 64 bit machine with that input file it takes about 19 >> seconds. > Eli I've tried your code and it takes forever 8min 36 sec to run on my > Machine(*). I've run the file from DrScheme IDE with both Dr Scheme > 4.15 that was in the ubuntu repositories and now I've downloaded and > installed 4.24 Linux - Fedora 7 (x86_64). The result is same over By default, DrScheme runs code in "debug mode", which means that it inserts lots of code instrumentation bits into the code, and that will make it run much faster. Usually the difference is neglegible, but of course it is much more noticeable in code like this. To turn debugging off, hit the "show details" and disable all debugging on the top part. But even with this there is additional overhead for running in DrScheme -- I see a runtime of 35 seconds. Running the code directly in mzscheme should make sure that you don't get any of these costs. Another strange thing is that your junk output looks very different from my junk output... I've changed the code a bit (you can get it from the same URL) to always use the "abc...xyz" string and print the contents in ASCII-friendly form -- this is the output that I see: #"abcdefghijklmnopqrstuvwxyz" SAMPLE is encrypted and seed is zeroed; commencing cracking...cpu time: 19292 real time: 19295 gc time: 320 The seed is: 174187923 The file is: #"<B!q\25z\1oP\vDJgm\17I]m\vUXwD\31\34@" -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life!
From: Nicolas Neuss on 14 Mar 2010 17:49 Eli Barzilay <eli(a)barzilay.org> writes: > My guess is that you're using a 32-bit machine. MzScheme (like many > other Lisps and Schemes) uses 1 bit to distinguish fixnums from other > values -- so code that does a lot of 32-bit arithmetics gets a huge > penalty in the form of allocating each such number. (Or maybe you're > using an old version?) It's a 64-bit-machine, otherwise also SBCL would be much slower. The version is from Debian Lenny (not that old): Welcome to MzScheme v4.2.1 [3m], Copyright (c) 2004-2009 PLT Scheme Inc. Nicolas
From: Eli Barzilay on 14 Mar 2010 19:13 Nicolas Neuss <lastname(a)kit.edu> writes: > Eli Barzilay <eli(a)barzilay.org> writes: > >> My guess is that you're using a 32-bit machine. MzScheme (like many >> other Lisps and Schemes) uses 1 bit to distinguish fixnums from other >> values -- so code that does a lot of 32-bit arithmetics gets a huge >> penalty in the form of allocating each such number. (Or maybe you're >> using an old version?) > > It's a 64-bit-machine, otherwise also SBCL would be much slower. > The version is from Debian Lenny (not that old): > > Welcome to MzScheme v4.2.1 [3m], Copyright (c) 2004-2009 PLT Scheme > Inc. I don't know what could be wrong then -- I've just tried 4.2.1 and it is slower -- but only by about 2 seconds. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life!
From: Nicolas Neuss on 15 Mar 2010 06:58
Eli Barzilay <eli(a)barzilay.org> writes: > [a very good technical post] and ends with > [In any case, this opst probably has an even higher number of flame > hooks, so I'll plonk this thread too.] Why are you so defensive? IMO, these lines are the only flame-bait in your post because you assume that your audience is not capable of discussing technical points. I have taken again a look at the PLT homepage, and liked very much what I have seen. I am a little in doubt, if PLT can with good conscience be called "Scheme" any more - it seems to be more aimed at becoming the ultimate Borg of programming languages. Anyway, I wouldn't mind having a PLT module "common-lisp" available:-) Nicolas |