| Author |
Comment/Response |
Alvin
|
07/20/08 00:21am
Hi all,
Has anyone tried the BinaryRead and test the speed?
Well, here's what I got.
When testing the BinaryRead I use this method
t1 = SessionTime[];
myExpression;
bps = bytesRead / (SessionTime[] - t1)
The file I used for this test was BMP file with size about 2.359 MB.
I have set the option BinaryFormat in OpenRead function to True
First, I set up a "Byte" table
b = Table["Byte", {1000000}];
myExpression = BinaryRead[myStream,b];
and the result was around 24000 ~ 25000 bps (byte / second)
Second, I used the Table itself.
myExpression = Table[BinaryRead[myStream],{1000000}];
this gives me 240000 ~ 250000 bps. (10x better) =P
but still it's much slower than Import does which is around 3 ~ 4 MB/s..
am I doing it wrong?
I was trying to read a 200MB file by using BinaryRead and watched my I/O traffic... that's why I got here..
Cheers
URL: , |
|