octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #54100] fread using SKIP larger than zero is e


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #54100] fread using SKIP larger than zero is extremely slow
Date: Mon, 23 Jul 2018 05:08:24 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #15, bug #54100 (project octave):

Here's the latest development result (similar to the result you listed):


octave:21> fid = fopen("zeros1000by61.dat","r");
octave:22> tic; xt = fread (fid, [1000, 60], 'single'); toc
Elapsed time is 0.0011611 seconds.
octave:23> fclose(fid);
octave:24> fid = fopen("zeros1000by61.dat","r");
octave:25> tic; xt = fread (fid, [1000, 60], 'single', 4); toc
Elapsed time is 0.0222042 seconds.


I'm attaching a *very* crude implementation of the post-read large buffer
condensation method.  It may crash for the non-skip case right now, but I'm
just trying to illustrate the improvement in speed for the skip case:


octave:1> fid = fopen("ramp1000by61.dat","r");
octave:2> tic; xt = fread (fid, [1000, 60], 'single', 4); toc
block_size: 1
N_block: 60000
Elapsed time is 0.00137806 seconds.
octave:3> xt(1,:)
ans =

 Columns 1 through 16:

    1    3    5    7    9   11   13   15   17   19   21   23   25   27   29  
31

 Columns 17 through 31:

   33   35   37   39   41   43   45   47   49   51   53   55   57   59   61

octave:4> size(xt)
ans =

   1000     31


(file #44607)
    _______________________________________________________

Additional Item Attachment:

File name: octave-fread_crude_large_hunk_prototype-djs2018jul22.diff Size:3 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54100>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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