Comment detail

ソートするコードの生成 (Nested Flatten)

This comment is reply for 3159 shiro: これはなかなか良い処理系いじめですね。 ...(ソートするコードの生成). Go to thread root.

いや、ロード時間の予想は甘いですね。もうひとつnのファクターがかかるから、5時間と2日、かな。

ベンチマークに使ったコードもつけておきます。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;; benchmark code
(use gauche.time)
(use srfi-27)

(define (bench n)
  (let ((gutimer (make <user-time-counter>))
        (gstimer (make <system-time-counter>))
        (lutimer (make <user-time-counter>))
        (lstimer (make <system-time-counter>))
        (rutimer (make <user-time-counter>))
        (rstimer (make <system-time-counter>))
        (data (with-output-to-string
                (lambda () (do-ec (: i n) (print (random-integer 100)))))))
    (with-time-counter gutimer
      (with-time-counter gstimer
        (with-output-to-file #`"sort-,|n|.scm" (cut gensort n))))
    (with-time-counter lutimer
      (with-time-counter lstimer
        (load #`"./sort-,|n|.scm")))
    (with-time-counter rutimer
      (with-time-counter rstimer
        (with-output-to-file "/dev/null"
          (cut with-input-from-string data (cut main '())))))
    (format #t "n=~d gen=~s/~s load=~s/~s run=~s/~s\n" n
            (time-counter-value gutimer)
            (time-counter-value gstimer)
            (time-counter-value lutimer)
            (time-counter-value lstimer)
            (time-counter-value rutimer)
            (time-counter-value rstimer)
            )))

Index

Feed

Other

Link

Pathtraq

loading...