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: Michael Leitner
Subject: [Octave-bug-tracker] [bug #54100] fread using SKIP larger than zero is extremely slow
Date: Tue, 12 Jun 2018 03:51:40 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

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

Wouldn't it be even better to just do a large binary read into an existing
buffer buf1 and then pick the values that you need, that is, in C it would
look somehow like


char * buf1;
double * buf2;

for (i=0;i<N;i++) buf2[i]=*(double *)(buf1+(sizeof(double)+skip)*i);


for the case of output in doubles. Of course, for very large skip-values one
should fall back to the present implementation, and for very large N you would
want to do this piece-meal in order not to explode your memory requirements.
If you think that this step of copying is inefficient, remember that in the
present case you even have some function calls per value, and that whenever
you have a non-starred precision argument (other than double) you have to do
the casting and copying in any case. 


    _______________________________________________________

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]