Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Is BinaryRead slow?' topicStudent Support Forum > General > Archives > "Is BinaryRead slow?"

Next Comment >Help | Reply To Topic
Author Comment/Response
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[];
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..


URL: ,

Subject (listing for 'Is BinaryRead slow?')
Author Date Posted
Is BinaryRead slow? Alvin 07/20/08 00:21am
Re: Is BinaryRead slow? Xavier 07/29/08 06:38am
Re: Is BinaryRead slow? Forum Modera... 08/05/08 08:55am
Next Comment >Help | Reply To Topic