[bug #68174] dlmread performance can be improved with modern C++
"Dmitri A. Sergatskov" <[email protected]>
| Newsgroups | gmane.comp.gnu.octave.bugs |
|---|---|
| Message-ID | <[email protected]> |
Please use the bug tracker to post updates to a bug report. The mailing list is intended as a read-only notification stream. Info posted to this mailing list address won't appear in the tracker database where it is most useful.
URL:
<https://savannah.gnu.org/bugs/?68174>
Summary: dlmread performance can be improved with modern C++
Group: GNU Octave
Submitter: dasergatskov
Submitted: Wed 25 Mar 2026 02:35:49 AM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Performance
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Unlocked
Release: dev
Operating System: Any
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Wed 25 Mar 2026 02:35:49 AM UTC By: Dmitri A. Sergatskov <dasergatskov>
While working on bug #68167 I noticed that the inner loop in the parser (in
dlmread) uses very expensive things: "std::string str = line.substr (...)"
creates a new std::string object which may trigger heap alloc/dealloc.
std::istringstream is notoriously slow: see e.g.:
https://stackoverflow.com/questions/5830868/c-stringstream-is-too-slow-how-to-speed-up
I think the performance could be improved by using allocation-free
"string_view" and "from_chars" for numbers parsing.
I should be able to make a CSET soon.
Dmitri.
--
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68174>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCacNKCQAKCRCqLAuaBUf3 Tu/qAP9fRzv9IPuW2L5EpEig/4PmoFXvAFlFK/1xYZcdoRGZBwEAluEyQMFwuKfP SE4WpS997uxHUcj+93HmUx1+7x1rqgU= =9uSD -----END PGP SIGNATURE-----