octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65060] classdef: extremely slow writing to ar


From: A.R. Burgers
Subject: [Octave-bug-tracker] [bug #65060] classdef: extremely slow writing to array properties
Date: Tue, 26 Dec 2023 04:41:48 -0500 (EST)

Follow-up Comment #1, bug#65060 (group octave):

I made a mistake in my original example, revised and simplified file foo2.m
u_foo2.m attached. The assigns to the numerical array are extremely slow,
despite the array being pre-allocated.

output of u_foo2.m


Time for assign to array: 0.000345945
Time for assign to property: 5.56618


u_foo2.m:


__vm_enable__(0);
nrep =  30;
dims = [2000, 2, 20300];

data_d = zeros(dims);

f_classdef = foo2;
f_classdef.data_d = zeros(dims);

dat_set = rand(dims(1), dims(2));

tic;
for i = 1 : min(nrep, dims(3))
  data_d(:, :, i) = dat_set;
end
fprintf('Time for assign to array: %g\n', toc);

tic;
for i = 1 : min(nrep, dims(3))
  f_classdef.data_d(:, :, i) = dat_set;
end
fprintf('Time for assign to property: %g\n', toc);




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65060>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]