chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: sloooow (read)


From: Cs. Henk
Subject: [Chicken-users] Re: sloooow (read)
Date: Tue, 25 May 2004 17:11:58 +0200
User-agent: Mutt/1.5.6i

Hi!

(Sorry if this post breaks threading, I've just subscribed, I don't have
the original post, thus this reply is not a reply in the technical sense
of the word...)


Alain MELLAN wrote:
> All,
>
> I made a small silly program to test the IOs, because it looked
> sluggish, and tested against Bigloo 2.6a. This is what I get:
>
> Bigloo:   1.290u 0.100s 0:01.40 99.2%     0+0k 0+0io 648pf+0w
> Chicken: 12.980u 0.340s 0:13.33 99.9%     0+0k 0+0io 436pf+0w
>
> that's fairly bad :-(
>
> Any idea where all these cycles go?
>
> Below is my test program (basically makes a *big* list, writes it to
> disk and reads again):
>
> ----------->8-------------->8------------->8---------------
> (define a (vector->list (make-vector 1000000 '())))
>
> (define port (open-output-file "asdf.asdf"))
> (write a port)
> (close-output-port port)
>
> (set! port (open-input-file "asdf.txt"))
> (define b (read port))
> (close-input-port port)
> ----------->8-------------->8------------->8---------------

Let's make bigloo a bit more verbose...

(module iotest
  (main main))

(define (main argv)
(define a (vector->list (make-vector 1000000 '())))
(display "list has been created\n")

(define port (open-output-file "asdf.txt"))
(write a port)
(close-output-port port)
(display "list written to file\n")

;; For some reason bigloo didn't like re-setting the port variable
;; from an input port to an output one, so I use a new variable
;; for output.
(define port2 (open-input-file "asdf.txt"))
;; Of course we use "asdf.txt" both times...
(define b (read port2))
(close-input-port port2)
(display  b)
)

Compile, run... What gives?

$ bigloo iotest.scm -o iotest
$ ./iotest 
list has been created
list written to file
#eof-object

Lol... it's easy to be fast this way :)

Btw, if you find that Chicken's IO is slow you may give a try to the
sfio egg (i didn't try it personally I just saw there is such a thing).

Cheers,
Csaba




reply via email to

[Prev in Thread] Current Thread [Next in Thread]