[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #58105] isfield needs time proportional to num
From: |
Arun Giridhar |
Subject: |
[Octave-bug-tracker] [bug #58105] isfield needs time proportional to number of fields |
Date: |
Mon, 3 Oct 2022 21:31:23 -0400 (EDT) |
Follow-up Comment #13, bug #58105 (project octave):
Finally got a chance this evening to update the patch and the tests.
Updated patch attached. This is a modern version of comment #7, using m_foo
instead of foo as member variable names in various places.
Updated benchmark code attached. This simplifies and accelerates the code from
comment #0.
Unpatched code scales linearly for each trial, so quadratically overall.
Patched code is constant for each trial, so linear overall. The speedup for N
= 2000 reduces 46 seconds to 0.2 seconds, so some 230X faster for this test
alone. Longer tests would make an even bigger difference. More important is
the scaling itself though.
Please review and test.
@Anon: If you want credit for this patch please list your name and email as
you would like it to appear.
(file #53783, file #53784, file #53785, file #53786)
_______________________________________________________
Additional Item Attachment:
File name: updated.patch Size:2 KB
<https://file.savannah.gnu.org/file/updated.patch?file_id=53783>
File name: bench_isfield.m Size:0 KB
<https://file.savannah.gnu.org/file/bench_isfield.m?file_id=53784>
File name: unpatched.png Size:37 KB
<https://file.savannah.gnu.org/file/unpatched.png?file_id=53785>
File name: patched.png Size:36 KB
<https://file.savannah.gnu.org/file/patched.png?file_id=53786>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58105>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/