bugGNU Octave - Bugs: bug #50688, orderfields is slow

 
 

bug #50688: orderfields is slow

Submitted by:  Guillaume <gyom>
Submitted on:  Fri 31 Mar 2017 10:02:13 AM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Performance
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 05 Apr 2017 07:06:30 PM UTC, comment #2: 

I did some benchmarking and the new code runs in about 1/2 the time of the old code even for small numbers of fieldnames.  I committed the change to the development branch under Guillaume's name here (http://hg.savannah.gnu.org/hgweb/octave/rev/4f07b4770eec).  One change to the patch I did make was to revert to using more explicit error messages for the input validation.

Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Fri 31 Mar 2017 08:26:19 PM UTC, comment #1: 

What is the benchmarking data for structures with a more ordinary number of fields, say 15?

Ideally, your implementation will be faster for these as well.  But if it isn't, then we don't necessarily want to optimize for the rare case of 2000 fields.

Rik <rik5>
Project Administrator
Fri 31 Mar 2017 10:02:13 AM UTC, original submission:  

I noticed in bug #49559 that orderfields() was quite slow for large structures. I rewrote it to minimize the number of calls to sort() and replace the for-loop over fieldnames with a call to struct2cell()/cell2struct(). It seems to be about two orders of magnitude faster for a structure with 2000 fields.

Guillaume <gyom>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #40218:  of.diff added by gyom (4KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-05 rik5 StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2017-04-05 siko1056 StatusNone => Confirmed
    2017-03-31 gyom Attached File- => Added of.diff, #40218

    Back to the top


    Powered by Savane 3.5