[gambit-list] Scheme/C help request for code needed for Math paper
richter at math.northwestern.edu
Tue Jan 25 00:07:15 EST 2005
I have almost 800 lines of Gambit code, at the top of my web page
and I hope someone can help me make the code run faster.
My advisor got roughly similar speed 20 years ago on stone-age Sun2s,
but writing C code directly. Seems to me that a Scheme->C translator
like Gambit (Version 4.0 beta 11) ought to perform comparably to
writing the program in C. At least if the Scheme code is good! I can
see two possible ways to improve the Scheme code:
1) slicker datatypes for some lists of lists of small integers
2) more sophisticated sorting
but I have no idea. I worked pretty hard to clean the code up, to
make it readable, but I'm no speed wizard, like you and Brad.
My code computes some list for each nonnegative t, and it starts to
bog down at t = 50. Here's the time output for t = 53:
7044096 ms real time
6974840 ms cpu time (6953810 user, 21030 system)
43801 collections accounting for 1622147 ms real time (1602770 user, 2510 system)
524299620112 bytes allocated
3641413 minor faults
10 major faults
That's 117.4 minutes of real time, almost 2 hours, including 27.0
minutes of garbage collection, and it looks to me like 524 gB of RAM
(can that be right? the machine has 1 gB RAM and a 2.4 GHz cpu).
But 2 hours in about as long as I can sit down at the console of a
public machine, and if I submit a job and log out, it hangs. It hangs
also if I nice a job. These 2 facts seem very strange to me. So I've
gotten as much output as I'm going to get, unless you can help me out,
or I win the lottery and buy a machine like this for myself.
Here's something funny about nice/log-out: The job for t = 52 ran
(un-niced) in 82 minutes, while I was sitting at the console of this
public machine. But when I ran it nice-ed, it didn't finish in 7
hours, even with 3 of those hours sitting at the console.
More information about the Gambit-list