MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Import[] command 100 times slower than ReadList [] ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg23566] Re: Import[] command 100 times slower than ReadList [] ?
  • From: "Dale Horton" <daleh at wolfram.com>
  • Date: Sat, 20 May 2000 03:10:39 -0400 (EDT)
  • Organization: Wolfram Research, Inc.
  • References: <8fb1cm$hm1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

ReadList will always be faster because of its nature.

ReadList reads a specified type of data.
Import reads any type of data. This requires checking the data.

There are plans to speed up Import in certain cases (your example would be
one of those cases),
but Import will never be as fast as ReadList.

-Dale

Krautschik, Chris G <krautschikc at intel.co.jp> wrote in message
news:8fb1cm$hm1 at smc.vnet.net...
> Hi Mathgroup,
>
> Manny thanks to all of you who helped me get my previous data matrix
problem
> solved ( Allan Hayes, Bob Hanlon, and Mark Harder).
>
> I have been using the Import command to import various 2-D data matrices.
> For a 513x122 data matrix text file I use the following command:
>
> xyData=Import["xyFile.txt","Table"]
>
> This task takes 117 seconds to complete (as timed by Timing[]).
>
> When I use ReadList:
>
> inFile = OpenRead["xyFile.txt"];
> xyData = ReadList[ inFile, Number, RecordLists -> True];
> Close[inFile];
>
> This task only takes 1.26 seconds.
>
> Why the huge performance difference?  I would prefer to use the Import
> command since it is so easy to use but find it too slow for my uses.
>
> thanks,
> Chris
>
>




  • Prev by Date: bug in InequalitySolve version 3?
  • Next by Date: Re: need little help
  • Previous by thread: Import[] command 100 times slower than ReadList [] ?
  • Next by thread: Re: matrices, dot products and convergents ofcontinued fractions