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

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

[Octave-bug-tracker] [bug #58564] classdef instance field access painful


From: Neil Konzen
Subject: [Octave-bug-tracker] [bug #58564] classdef instance field access painfully slow vs. struct field access
Date: Sun, 14 Jun 2020 07:05:20 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45

URL:
  <https://savannah.gnu.org/bugs/?58564>

                 Summary: classdef instance field access painfully slow vs.
struct field access
                 Project: GNU Octave
            Submitted by: waterdog1
            Submitted on: Sun 14 Jun 2020 11:05:18 AM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Performance
                  Status: None
             Assigned to: None
         Originator Name: waterdog1
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Direct access to a classdef instance field is 3x slower than accessing a
struct field.  The attached 3 .m files demonstrate the timing; below are the
timings I get with Octave 5.2 on my AMD 3900x machine with 32Gb memory.


struct: obj.field access time = 1.484 usec
struct: obj.('field') access time = 1.733 usec
struct: subsref(obj,struct) access time = 5.875 usec

value_class: obj.field access time = 4.483 usec
value_class: obj.('field') access time = 4.707 usec
value_class: subsref(obj,struct) access time = 10.059 usec

handle_class: obj.field access time = 4.620 usec
handle_class: obj.('field') access time = 4.797 usec
handle_class: subsref(obj,struct) access time = 9.911 usec


(I'm not concerned too much about subsref() timing; it's shown for reference
only)



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 14 Jun 2020 11:05:18 AM UTC  Name: field_access_timing.m  Size: 1KiB
  By: waterdog1
all three files in current directory, run field_access_timing.m
<http://savannah.gnu.org/bugs/download.php?file_id=49258>
-------------------------------------------------------
Date: Sun 14 Jun 2020 11:05:18 AM UTC  Name: value_class.m  Size: 74B   By:
waterdog1
all three files in current directory, run field_access_timing.m
<http://savannah.gnu.org/bugs/download.php?file_id=49259>
-------------------------------------------------------
Date: Sun 14 Jun 2020 11:05:18 AM UTC  Name: handle_class.m  Size: 85B   By:
waterdog1
all three files in current directory, run field_access_timing.m
<http://savannah.gnu.org/bugs/download.php?file_id=49260>

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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