Newsgroups: comp.lang.scheme
From: John David Stone <st...@cs.grinnell.edu>
Date: 12 Jan 2002 15:18:16 -0600
Local: Sat, Jan 12 2002 4:18 pm
Subject: Re: The FASTEST subsets function [Was: Subsets of a list]
o...@pobox.com (o...@pobox.com) writes: Hmm. In my testing environment: > The benchmark runs in 993 ms of user time and allocates only 36.5 MB > of memory, on Gambit-C interpreter. This is the absolute, incredible > record. Under SCM: > subsets-v3 (called combos by John David Stone) > subsets-v5: > (time (begin (subsets-v3 (list 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) 10) (values))) (time (begin (subsets-v3 (...) ...) ...)) 4 collections 200 ms elapsed cpu time, including 110 ms collecting 195 ms elapsed real time, including 106 ms collecting 4300568 bytes allocated, including 1818144 bytes reclaimed > (time (begin (subsets-v5 (list 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) 10) (values))) (time (begin (subsets-v5 (...) ...) ...)) 12 collections 400 ms elapsed cpu time, including 320 ms collecting 456 ms elapsed real time, including 365 ms collecting 13524544 bytes allocated, including 4595512 bytes reclaimed That is: Apart from garbage collection, the two procedures are My guess is that, in my testing environment, SUBSETS-V3 is getting > (time (begin (subsets-v3 (list 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) 10) (values))) cpu time: 1530 real time: 1532 gc time: 580 > (time (begin (subsets-v5 (list 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) 10) (values))) cpu time: 640 real time: 635 gc time: 330 John David Stone - Lecturer in Computer Science and Philosophy 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.
| ||||||||||||||