MathGroup Archive 2000

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

Search the Archive

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

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

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.


Krautschik, Chris G <krautschikc at> wrote in message
news:8fb1cm$hm1 at
> Hi Mathgroup,
> Manny thanks to all of you who helped me get my previous data matrix
> 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