Last active
December 18, 2015 03:38
-
-
Save yamasushi/5719441 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gosh memtest | |
#?="./memtest.scm":19:(gcstat-used-heap (gc-stat)) | |
#?- 1191.936 | |
#?="with-input-from-port" | |
#?- "with-input-from-port" | |
#?="./memtest.scm":24:(gcstat-used-heap (gc-stat)) | |
#?- 26759.168 | |
$ gosh memtest | |
#?="./memtest.scm":19:(gcstat-used-heap (gc-stat)) | |
#?- 1187.84 | |
#?="read-line only" | |
#?- "read-line only" | |
#?="./memtest.scm":24:(gcstat-used-heap (gc-stat)) | |
#?- 25575.424 | |
$ calc 26759.168 - 25575.424 | |
1183.744 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; memtest | |
(use srfi-1) | |
(define (gcstat-used-heap s) | |
(/ (- ($ car $ assoc-ref s :total-heap-size) ($ car $ assoc-ref s :free-bytes )) 1000.) ) | |
(define (read-data reader fname) | |
(call-with-input-file fname | |
(^ [in] (port->list reader in) ) | |
:encoding "Shift_JIS" | |
) ) | |
(define (test-reader port) (with-input-from-port port (^[] (read-line) ) ) ) | |
;(define (test-reader port) (with-input-from-port port (^[] (read-line port) ) ) ) | |
(define fname "/home/shuji/gauche-data/csv/ken_all.csv") | |
(debug-print-width #f) | |
(gc) #?=(gcstat-used-heap (gc-stat)) | |
;-------------------------------------- | |
#?="read-line only" (read-data read-line fname) | |
;#?="with-input-from-port" (read-data test-reader fname) | |
;-------------------------------------- | |
(gc) #?=(gcstat-used-heap (gc-stat)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment