Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7482

Re: Efficient way to read binary data line-by-line

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail
From Frank Iannarilli <frankeye@cox.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Efficient way to read binary data line-by-line
Date Fri, 30 Dec 2011 12:14:47 +0000 (UTC)
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <jdk9vn$8dn$1@smc.vnet.net> (permalink)
References <200909090846.EAA06073@smc.vnet.net> <h8d58e$167$1@smc.vnet.net>
Reply-To comp.soft-sys.math.mathematica@googlegroups.com
Lines 6
NNTP-Posting-Date 30 Dec 2011 11:19:52 GMT
NNTP-Posting-Host 4a547f8c.news.twtelecom.net
X-Trace DXC=2Q5K`Z?A276BdhbaOf?SM9C_A=>8kQj6=hHXa^^g6TZ4H7^L0=Y;R<>EFiONJ7[Go6jeVP\D4VId7
X-Complaints-To abuse@twtelecom.net
Xref x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:7482

Show key headers only | View raw


Leonid is spot-on with the sequential nature of BinaryReadList.

But BinaryRead is EXTREMELY inefficient compared to BinaryReadList (at least for version 8.0.1).  I just took a look at why, and it is apparently because the result from BinaryRead is NOT in PackedArray format (per `Developer`PackedArrayQ), even for a 65K-sized read request. 

OTOH, BinaryReadList returns a payload as a PackedArray, which implies its conversions from Bytes to requested type will be MUCH faster.  

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Efficient way to read binary data line-by-line Frank Iannarilli <frankeye@cox.net> - 2011-12-30 12:14 +0000

csiph-web