bug #65704: (symbolic) element-wise power slow

 Submitter: None Submitted: Tue 07 May 2024 04:32:57 AM UTC Category: Octave Package Severity: 3 - Normal Priority: 5 - Normal Item Group: Performance Status: Need Info Assigned to: None Originator Name: Originator Email: -email is unavailable- Open/Closed:  * Open Release:  * 8.4.0 Operating System:  * Microsoft Windows Fixed Release: None Planned Release: None
* Mandatory Fields

Add a New Comment Rich Markup

Discussion

Wed 08 May 2024 07:22:21 AM UTC, comment #3:

That looks like it might be related to the symbolic package.
Consider reporting the issue to its maintainers:
https://github.com/gnu-octave/symbolic/issues

Markus Mützel <mmuetzel>
Tue 07 May 2024 09:37:09 PM UTC, comment #2:

f=sym([10 30 50 70 90])
pw=[1 1 1 1 0;1 1 1 0 1;1 1 0 1 1;1 0 1 1 1;0 1 1 1 1;1 1 1 0 0;1 1 0 1 0;1 1 0 0 1;1 0 1 1 0;1 0 1 0 1;1 0 0 1 1;0 1 1 1 0;0 1 1 0 1;0 1 0 1 1;0 0 1 1 1;1 1 0 0 0;1 0 1 0 0;1 0 0 1 0;1 0 0 0 1;0 1 1 0 0;0 1 0 1 0;0 1 0 0 1;0 0 1 1 0;0 0 1 0 1;0 0 0 1 1;1 0 0 0 0;0 1 0 0 0;0 0 1 0 0;0 0 0 1 0;0 0 0 0 1;0 0 0 0 0];
%% SHORT but SLOW
tic
for d=1:10
U=sum(prod(repmat(f,size(pw,1),1).^pw,2))
end
toc
%% LONG but FAST
tic
for d=1:10
t=ones(sym([size(pw,1),1]));
p=pw;
for i=1:5
while(any(p(:,i)))
c=p(:,i) > 0;
t(c)*=f(i);
p(c,i)-=1;
end
end
V=sum(t)
end
toc

Anonymous
Tue 07 May 2024 01:27:54 PM UTC, comment #1:

We recognize that certain operations are faster, or more efficient than others. However, this may be but is not necessarily a bug in Octave.

Can you provide a specific code example of what you find concerning regarding relative computation speed? Is there a reason you think it is a bug in Octave causing that effect? It is unclear from the summary (hmst?)  what you are referring to.

Marking as Need Info for now, but we'll have to close this report as invalid without any clarifying information.

Nicholas Jankowski <nrjank>
Tue 07 May 2024 04:32:57 AM UTC, original submission:

Symbol power is very very slow. Multiplication is faster.

For test, count time for symbolic power and multiplication.

Anonymous

Attached Files

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

Attach Files:

Comment:

No files currently attached

Dependencies

Depends on the following items: None found

Items that depend on this one: None found

Mail Notification Carbon-Copy List

Carbon-Copy List
• -email is unavailable- added by mmuetzel (Posted a comment)
• -email is unavailable- added by nrjank (Posted a comment)
•

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only group members can vote.

History

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2024-05-08 mmuetzel CategoryPerformance Octave Package
Summaryhmst (symbolic) element-wise power slow
2024-05-07 nrjank CategoryNone Performance
Item GroupNone Performance
StatusNone Need Info