|
From: | Rik |
Subject: | [Octave-bug-tracker] [bug #54100] fread using SKIP larger than zero is extremely slow |
Date: | Mon, 23 Jul 2018 01:16:12 -0400 (EDT) |
User-agent: | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0 |
Update of bug #54100 (project octave): Priority: 5 - Normal => 3 - Low _______________________________________________________ Follow-up Comment #13: I used arithmetic and the number of bytes read to eliminate one of the calls to tellg. I also removed the unneccessary check on (! is) at the end of the skip block code as suggested in comment #6. See https://hg.savannah.gnu.org/hgweb/octave/rev/0812413a0bb7. Altogether it produced a 40% savings. Test results are now skip = 0: Elapsed time is 0.00130677 seconds. skip = 4: Elapsed time is 0.033772 seconds. So using skip is now 26X slower than not using skip, but it started out at 182X. The next step would be harder so I am going to stop. The problem now is that when skip != 0 the stream::read function is called in units of blocksize which for 'single' is just 4 bytes. When skip is zero the function reads in very large block sizes which is much more efficient. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?54100> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |