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

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

[Octave-bug-tracker] [bug #51871] loading '-ascii' format files is slow


From: count
Subject: [Octave-bug-tracker] [bug #51871] loading '-ascii' format files is slow
Date: Sat, 25 Nov 2017 03:14:28 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #41, bug #51871 (project octave):

Reply for comment #35:
  It is enough to just call clean() for std::string to clean the data, just
like std::vector, it is optimized. BTW: assign an empty string is a slower way
to clean it.
  Also this is what std::getline do. See
https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00293_source.html
    __str.erase();


Reply for comment #34:
  push_back() is fast, all slow thing is around std::istream.


I also tried implement a customized "getline" that accept all line endings, by
adopting the std::getline code. It operates in a lower level that deal with
(std::)stream buffer directly.

The surprising thing is: it is much slower (I can't recall the timing, maybe
later) than the std::getline even after I remove all the customizations,
that's say the GCC compiler has a specific optimization for std::getline, and
this optimization can not be triggered by simply copy the std::getline
implementation.


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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