I generate a list of numbers, write them to file, and test the time it takes to read it back. Attached is my file bench.scm<br><br>For most of them, plain_text appears to be faster; and only at 10 million entries, does the binary format become slightly faster. What am I doing wrong?<br>
<br>running with: gsi bench.scm<br><br><br>(number-of-entries: 1 (binary: 1.5497207641601562e-4) (plain: 9.679794311523438e-5))<br>(number-of-entries: 10 (binary: 8.487701416015625e-5) (plain: 6.699562072753906e-5))<br>(number-of-entries: 100 (binary: 1.399517059326172e-4) (plain: 1.6808509826660156e-4))<br>
(number-of-entries: 1000 (binary: .0024831295013427734) (plain: .0011830329895019531))<br>(number-of-entries: 10000 (binary: .004712104797363281) (plain: .005532979965209961))<br>(number-of-entries: 100000 (binary: .06526494026184082) (plain: .04858684539794922))<br>
(number-of-entries: 1000000 (binary: .8762490749359131) (plain: .55377197265625))<br>(number-of-entries: 10000000 (binary: 7.88455605506897) (plain: 9.257179021835327))<br><br><br><br><br><br><div class="gmail_quote">On Mon, Feb 16, 2009 at 11:37 AM, Jeremie Lasalle Ratelle <span dir="ltr"><<a href="mailto:pouexmachinax@gmail.com">pouexmachinax@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">object->u8vector and u8vector->object<br>
write-subu8vector and read-subu8vector on the file port<br>
<br>
What I currently do on tcp/ip port is to first write a u8vector of<br>
size 4 representing<br>
the size of the object following and then write the u8vector<br>
representing the object.<br>
<br>
I guess you could do the same in files. You would read 4 u8<br>
representing the size,<br>
read-subu8vector of the size read and repeat until eof.<br>
</blockquote></div><br>