[Scilab-users] Performance issue with mget on inhomogeneous binary file

phil_shvarcz phil.shvarcz at yahoo.com
Fri Dec 21 11:46:12 CET 2012


Hi all,

being new to scilab I'm not sure if my problem has a trivial solution or
not. I searched all documentation and forum postings but did not find
anything relevant for my problem. So that's it:

I need to read in quite big binary files (several 100MB) composed of
successive pairs of float (4 byte word) and double (8 byte word). That is,
the byte sequence looks like this ("ffff" is a 4-byte float and "dddddddd"
is an 8 byte double):
ffffddddddddffffddddddddffffddddddddffffdddddd

if I use this code:



the file is read in at an incredibly slow rate (a few MB take minutes to be
read in).

If I read in the entire file in one flush



it takes a second or so to read in 100MB. However, the data structure is
lost and the vector vb contains nonsensical doubles.

Is there a way in scilab to read in a (structureless) vector of bytes and
cast it to the right structure afterwards, like one would do with an array
in C ?

Besides, is it normal that mread is *so* slow when used to read a file in a
word-by-word manner instead of reading it in one big chunk?

Thanks for reading,
regards
Phil



--
View this message in context: http://mailinglists.scilab.org/Performance-issue-with-mget-on-inhomogeneous-binary-file-tp4025574.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list