[bug #68281] Stream MAT v7 compression directly to output files

"Dmitri A. Sergatskov" <[email protected]> Sat, 25 Apr 2026 13:52:51 -0400 (EDT)
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.

Follow-up Comment #2, bug #68281 (group octave):

The attached patch avoids writing temporary buffer prior to compression when
saving to mat-v7 format.
(file bug68281_mat7_20260425_100.cset)
Before:

octave:1> x = ones (2^31-2, 1, 'uint8');
octave:2> tic; save ('-binary', 'x.bin', 'x'); toc # reference
Elapsed time is 0.414707 seconds.
octave:3> tic; save ('-v7', 'x.mat7', 'x'); toc
Elapsed time is 2.30024 seconds.
octave:4> 

After:

octave:1> x = ones (2^31-2, 1, 'uint8');
octave:2> tic; save ('-v7', 'x.mat7', 'x'); toc
Elapsed time is 1.22243 seconds.


Dmitri.
-- 


(file #58510)

    _______________________________________________________

Additional Item Attachment:

Name: bug68281_mat7_20260425_100.cset Size: 8.6KiB

<https://file.savannah.gnu.org/file/bug68281_mat7_20260425_100.cset?file_id=58510>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-c36938be85ff6c1b727bc7dd7fd30e48f9142870.tar.gz


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68281>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaez/cwAKCRCqLAuaBUf3
Tom0AP9dp3BKkMEIUfjgjIsv2BwsQpjG/jvNejT+psKKX+zYkAEA2nB7x4n+TZno
J76AJkwts54eNtX+1oDH2ZM3rs764QM=
=V3Pz
-----END PGP SIGNATURE-----