octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slowness in function 'open'


From: Daniel J Sebald
Subject: Re: Slowness in function 'open'
Date: Sat, 23 Jun 2007 01:38:29 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

Daniel J Sebald wrote:

2) Open the existing file in binary format first and scan--in binary mode--for the number of new-line characters go get the M dimension. Then close/open the file in text mode and scan the first row for N. Rewind, and knowing M x N, off we go. Just run the existing algorithm. I would think the first binary pass would be very quick.

This one is basically "word count", isn't it.  I tried the following:

A = rand(1000,1000);
save -ascii test.m A
tic, load test.m; toc

Elapsed time is 15.198189 seconds.

Then

address@hidden ~]$ wc -l test.m
1000 test.m

comes back immediately.  That would be a savings if Octave currently has two 
identical passes.  Factor of almost 2, perhaps?  Saving to memory isn't the 
slow part, so I'll guess factory of 1.85 to 1.9.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]