write_data spends too much time to create file.




On Wed, 28 Jul 2010, Alejandro Morales wrote:

< 
< File  "new.dat"  is created with the following instructions:
< 
< (%i1)array(new,1000,1);
< (%i2) for a:0 thru 1000 step 1 do (new[a,0]:a,new[a,1]:a+1);
< (%i3) write_data(new,"new.dat");
< 
< After finishing the "for", "write_data"  spends 37 seconds to write the file
< "new.dat".
< Is there  a way to do the job faster?
< Thanks:Morales
 
I don't see this problem:

showtime:true $
array(new,1000,1) $
for a:0 thru 1000 step 1 do (new[a,0]:a,new[a,1]:a+1) $
write_data(new,"new.dat");

Evaluation took 0.0000 seconds (0.0000 elapsed) using 8 bytes.
Evaluation took 0.0000 seconds (0.0000 elapsed) using 8.398 KB.
Evaluation took 0.0600 seconds (0.0600 elapsed) using 579.039 KB.
Evaluation took 0.2300 seconds (0.2300 elapsed) using 2.836 MB.

build_info();

Maxima version: 5.21.1
Maxima build date: 20:11 5/9/2010
Host type: i686-pc-linux-gnu
Lisp implementation type: CMU Common Lisp
Lisp implementation version: CVS 19d 19d-release (19D)

Leo

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.