|
From: | Guillaume |
Subject: | [Octave-bug-tracker] [bug #50688] orderfields is slow |
Date: | Fri, 31 Mar 2017 06:02:14 -0400 (EDT) |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0 |
URL: <http://savannah.gnu.org/bugs/?50688> Summary: orderfields is slow Project: GNU Octave Submitted by: 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: None Assigned to: None Originator Name: Guillaume Originator Email: Open/Closed: Open Discussion Lock: Any Release: dev Operating System: Any _______________________________________________________ Details: 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. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Fri 31 Mar 2017 10:02:13 AM UTC Name: of.diff Size: 4kB By: gyom <http://savannah.gnu.org/bugs/download.php?file_id=40218> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?50688> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |