bugGNU Octave - Bugs: bug #45461, binornd inefficient, patch attached

 
 

bug #45461: binornd inefficient, patch attached

Submitted by:  None
Submitted on:  Thu 02 Jul 2015 11:55:19 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Performance
Status: NoneAssigned to: None
Originator Name: Michael LeitnerOriginator Email: -unavailable-
Open/Closed: OpenRelease: 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.

 

Thu 02 Jul 2015 11:55:19 AM UTC, original submission:

The present implementation of binornd is very inefficient. For non-scalar N it computes max(N(:))*numel(N) random values (and uses memory on the same order of magnitude). The attached patch uses only sum(N(:)) random values. Of course, the algorithm is still inefficient (one could work via the cdf), but for a range of use cases it is perfectly usable in contrast to the old implementation.

Demonstration:

takes 2.4 s for the old and 0.008 s for the new one.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #34360:  patch added by None (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 02 Jul 2015 11:55:19 AM UTCNoneAttached File-=>Added patch, #34360

    Back to the top


    Powered by Savane 3.1-cleanup1