Add a New Comment (Rich Markup)
Comment Type & Canned Response: None None > Multiple Canned Responses Fixed in development Crash with no stack trace Already fixed in newer version Fixed in stable Bad description Bad description and crash Bad stack trace Obsolete version Duplicate and not fixed Duplicate and needs more info Duplicate and fixed Need info and old
Rik, see also https://savannah.gnu.org/patch/?10147 and some other recent proposed changes from the same contributor. I'm not sure I agree with all of those, but he has also looked at eliminating some allocations.
I think Octave is doing a lot of malloc/free operations, probably more than we need, and which is related to the creation of temporary objects such as returning octave_value objects or octave_value_list objects from functions. That is going to be hard to quickly fix.
The one thing that does strike me is the __nss_database_lookup which is taking 7.4% of the time. Is this a consequence of having remote directories on the PATH for Octave? That seems like a lot of database lookups.
Attached profiles obtained with google-pprof: flat text profile and graphical representation. Scripts run at N=1.e7, since the profiling granularity was quite course, not sure these results already have enough statistical significance.
Time spent in lookin up the function the symbol table and executing the call.
(file #52836, file #52837)
I used the following script to benchmark the calling overhead in Octave.
N = 1e6; tic; for i = 1:N ## Empty for loop body endfor bm1 = toc function NOP () endfunction tic; for i = 1:N ## Call NOP subfunction NOP (); endfor bm2 = toc tic; for i = 1:N ## Call C++ emptyoct function emptyoct(); endfor bm3 = toc
The accompanying emptyoct.cc file is
#include <octave/oct.h> DEFUN_DLD (emptyoct, args, nargout, "emptyoct does nothing, and should be fast") { return ovl (octave_value ()); }
The results were
bm1 = 0.074267 bm2 = 2.2344 bm3 = 1.2721
Even with C++ there is a fair amount of overhead.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
Depends on the following items: None found
Items that depend on this one: None found
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 project members can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 4 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.9