[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Speed reduction of 2.1.48 wrt 2.1.36 for structures
From: |
David Bateman |
Subject: |
Speed reduction of 2.1.48 wrt 2.1.36 for structures |
Date: |
Mon, 26 May 2003 16:05:38 +0200 |
User-agent: |
Mutt/1.3.28i |
Working to trying and find out why someones code here ran substantially
slower under the new versions of octave. The problem was isolation to
the accessing of stuctures within for loops. Consider the code
x.a = 1;
x.b = 1;
xa = x.a;
xb = x.b;
tic; for i=1:10000, y.a = x.a(x.b); endfor; toc
tic; for i=1:10000, ya = xa(xb); endfor; toc
x.a = ones(1,1024);
x.b = 1:1024;
xa = x.a;
xb = x.b;
tic; for i=1:1000, y.a = x.a(x.b); endfor; toc
tic; for i=1:1000, ya = xa(xb); endfor; toc
Under 2.1.36 on my machine I get the results
ans = 0.31809
ans = 0.22774
ans = 0.20027
ans = 0.19229
Under 2.1.48 I get
ans = 0.67814
ans = 0.26059
ans = 0.28205
ans = 0.23896
As can be seen the first test where there is little vectorization, thhe
accessing of the structures is substantially slower under the recent versions
of the code. The tests above were run on the same machine and config
flags (eg math libraries etc)..
Regards
David
--
David Bateman address@hidden
Motorola CRM +33 1 69 35 25 00 (Ph)
Espace Technologique, Commune de St Aubin +33 1 69 35 25 01 (Fax)
91193 Gif-Sur-Yvette FRANCE
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
- Speed reduction of 2.1.48 wrt 2.1.36 for structures,
David Bateman <=