|
From: | anonymous |
Subject: | [Octave-bug-tracker] [bug #59840] repmat and repelem slower than needed, faster implimentation suggested |
Date: | Mon, 18 Jan 2021 23:36:46 -0500 (EST) |
User-agent: | Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0 |
Follow-up Comment #8, bug #59840 (project octave): After letting it run all night and generating over a gigabyte of timing for every combination data I found a simple function for where to switch between the kron and idx implementations for both repmat and repelem: if m*n*p*q<128e3 and double precision, kron normally faster otherwise idx faster if m*n*p*q<128e3*2 and single precision, kron normally faster otherwise idx faster There is a significant increase in computation time at the above switch location for both methods. As having the precision doubled the product constant I'm confident the difference in speed is related to memory. This may mean the constant is different for different computers. I have attached the code and some small data files. I have drawn a line for the transition between the methods below the timing plots, currently it is for single precision (remove the times 2 for double precision). (file #50748) _______________________________________________________ Additional Item Attachment: File name: repmatrepelemfaster.m Size:20 KB <https://file.savannah.gnu.org/file/repmatrepelemfaster.m?file_id=50748> _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?59840> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |