[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Slowup in 2.1.54
From: |
John W. Eaton |
Subject: |
Re: Slowup in 2.1.54 |
Date: |
Wed, 18 Feb 2004 13:20:33 -0600 |
On 18-Feb-2004, Paul Thomas <address@hidden> wrote:
| Whilst it is a bit at right angles to the discussion because the fault
| with the [] operator was fixed, should we really worry about constructs
| like
|
| j = 1e 4; tic; x = []; for i=1:j; x = [x, i]; endfor; toc
|
| that have square law scaling with the length of i?
|
| j = 1e4; tic; x = zeros(1, j); for i = 1:j; x(i) = i; endfor; toc
|
| is 30 times faster, at j=1e4, and is linear in j.
It's true that you shouldn't be using the first form if you can avoid
it, but the fact that it was so much slower going from 2.1.53 to
2.1.54 showed that the run time was not completely dominated by
reallocating memory. So I think it would also mean that we would have
also seen a big drop in performance for the [] operator with a large
number of elements.
jwe
- Slowup in 2.1.54, David Bateman, 2004/02/17
- Slowup in 2.1.54, John W. Eaton, 2004/02/17
- Re: Slowup in 2.1.54, Dmitri A. Sergatskov, 2004/02/17
- Re: Slowup in 2.1.54, Paul Thomas, 2004/02/18
- Re: Slowup in 2.1.54,
John W. Eaton <=
- Re: Slowup in 2.1.54, Paul Thomas, 2004/02/18
- Re: Slowup in 2.1.54, John W. Eaton, 2004/02/18
- Re: Slowup in 2.1.54, David Bateman, 2004/02/18
- Re: Slowup in 2.1.54, Paul Kienzle, 2004/02/18
- Re: Slowup in 2.1.54, Daniel J Sebald, 2004/02/18
- Re: Slowup in 2.1.54, Paul Thomas, 2004/02/19
- Re: Slowup in 2.1.54, John W. Eaton, 2004/02/20
- Re: Slowup in 2.1.54, Paul Thomas, 2004/02/22