[bug #68090] Performance improvements to classdef load-save in MAT-files

foreverallama <[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/?68090>

                 Summary: Performance improvements to classdef load-save in
MAT-files
                   Group: GNU Octave
               Submitter: foreverallama
               Submitted: Wed 25 Feb 2026 04:29:04 PM UTC
                Category: Classdef
                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 Feb 2026 04:29:04 PM UTC By: foreverallama <foreverallama>
This patch contains some small performance improvements to load-save of
classdef objects in MAT-file subsystem data. Changes as follows:
* New exception class "subsystem_exception" in ls-mat-subsys.h
* Throw/Handle exceptions for unsupported version and property type
* Add test for exception handling (with binary modified MAT-files)
Note: Is it a good idea to add a catch-all and raise an error? Could prevent
Octave from crashing, although surprisingly MATLAB doesn't seem to handle
it/crashes as well.

Performance Optimizations:
* Prevent subsystem data from loading twice (for some reason,
"read_mat5_binary_file_header" runs twice)
* Wrap uint8 subsystem data around a custom memory buffer to prevent copying
for processing
* Small performance improvements to loading property values, class and
property names

I believe subsystem load-save is reasonably optimised. The main bottleneck is
actually in loading integer types, for which I will open a separate bug






    _______________________________________________________
File Attachments:

Name: optimize_subsystem.patch       Size: 14KiB

<https://file.savannah.gnu.org/file/optimize_subsystem.patch?file_id=58278>

Name: unsupported-version.mat        Size: 1.4KiB
    <https://file.savannah.gnu.org/file/unsupported-version.mat?file_id=58279>

Name: unsupported-prop-type.mat      Size: 1.4KiB

<https://file.savannah.gnu.org/file/unsupported-prop-type.mat?file_id=58280>



    AGPL NOTICE

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

    _______________________________________________________

Reply to this item at:

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

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

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaZ8jVAAKCRCqLAuaBUf3
TpDfAQCY5JfMBkiDYabEfKuCA9hZyp8vPapGKWFKp2qS1M+k8gD+M4lnNNkSVeKx
HPV9fe+xflU35w2edNc/AVx7Zx358Q8=
=XU8S
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.