[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #39834] vertcat() very slow compared to horzca
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #39834] vertcat() very slow compared to horzcat() |
Date: |
Wed, 21 Aug 2013 04:18:11 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0 |
URL:
<http://savannah.gnu.org/bugs/?39834>
Summary: vertcat() very slow compared to horzcat()
Project: GNU Octave
Submitted by: rik5
Submitted on: Tue 20 Aug 2013 09:18:10 PM PDT
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Performance
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: GNU/Linux
_______________________________________________________
Details:
Running what looks to be equivalent workloads through vertcat and horzcat
produce very different running times---about 9X slower for vertcat. The code
is attached below as bm_vertcat.m.
N = 1e3;
################################################################################
clear y1;
y1 = zeros (N,N);
x = repmat ({[1:N]}, N, 1);
tic;
y1 = vertcat (x{:});
toc
clear y2;
x = repmat ({[1:N]'}, 1, N);
tic;
y2 = horzcat (x{:});
toc
And when run
Elapsed time is 0.095994 seconds.
Elapsed time is 0.010987 seconds.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tue 20 Aug 2013 09:18:10 PM PDT Name: bm_vertcat.m Size: 454B By:
rik5
<http://savannah.gnu.org/bugs/download.php?file_id=28891>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?39834>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #39834] vertcat() very slow compared to horzcat(),
Rik <=