octave-maintainers
[Top][All Lists]
Advanced

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

[Patch] Profiler update, interface function


From: Daniel Kraft
Subject: [Patch] Profiler update, interface function
Date: Thu, 14 Jul 2011 22:48:13 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

after today's discussion, here's an update for my profiler.  I greatly
extended the data collection done in profile_data_accumulator, and also
added a .m-file function which provides 'profile' to the user.

It has an interface similar to Matlab's profile function (at least I
hope that also Matlab users will see it so), but only supports some of
the options the Matlab version has and also produces only parts of the
outputs.

I hope that the new data collection (which looks through the call-stack
and also keeps track of child/parent functions) is not too expensive to
do at possibly every function call; what do you think?  But I don't see
how we could do it any other way and still get the output Matlab gives.

BTW, IsRecursive in my patch returns true iff at some point, the
function called was already somewhere on the call-stack; so foo below
will be recursive:

function r = foo (a)
  r = bar (a);
end

function r = bar (a)
  if (a == 0)
    r = 1;
  else
    r = a * foo (a - 1);
  end
end

Or should only functions be recursive where the function itself is a
direct parent/child?  The implemented behaviour seems more reasonable to
me (and is for instance what RECURSIVE in the Fortran standard means),
but I don't know what Matlab does.

What do you think about this patch?

Besides obviously correcting it for things that turn up, I think I'll
try to look into profiling of operators and fixing the anonymous
functions next.  Hm, or maybe implement a flat-profile "nice" output
routine first, because without one, I don't think the current profiling
information is of much use to an end-user in the structure format at the
moment.

Yours,
Daniel

- -- 
OpenPGP: 3BA2 3DDB 7758 F010 BDAB 0DCF 527E 79BA A3B5 3998
- --
Done:  Arc-Bar-Cav-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Mon-Pri
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOH1YMAAoJEFJ+ebqjtTmYodcP/i9QWa4K+RZPl4BnKEJNAyYg
5fXGXS3wquci+b3l45b0B3xOKJk7DnvKDq4E7DMHo7GfAOeTVStAd2qLa7es0gjG
e8IvxWz5uZ88x4lDudqdNCkRUqe8aUYp8fqU3VHztV93+EbgNW5gfkgiy96ZBJJm
UqBm2Je1Pl0gsEyokrbKCs1lh2FT7WA+c5Upq4qhtCfB41VPFfBeI/W7B11w4WOK
oQiDDB6QF7vDA8tQ7YMXQdxK1pttH5MDnumx/KPziZq6yH6tSCQ/3DDBngtdjOU7
590Jul52tKCdL+g89E7UuttOIZ4cSt1xT6TdARrzt80cl9H980OCgU9c8PMXdKHW
JkRbBdLcg74q8knUYz9kSa72AbKwo76RAM8GSqSCDl1GA6uvVbz+wlUmyDlaSUPg
LZRjUlkYp7N3INE+/WkNrwnbupQ0vk2SK6IkcpaIwxPrJBO5Qmoyv3Hc0EJwdlko
gHypiGVsPkHhcTF1bKfK9WXFODM+uXXX1Q7hl0HDJ7oeRYR5jg4i56MZ0hiu+laV
938bC7hQoNFCKpSwTC1jXW8WLhzBgO0jlG5XARx0eawVO0yu9LFaApRYIAMumnaY
JCWvMT2oIw4Q3qxRP7CfbuI9VXqPJ5G3iGMLsLImiZ+r5Ji6W6Xq57cI9bGAvTfb
BnakHEv42I5uAvHm4hY8
=rCf+
-----END PGP SIGNATURE-----

Attachment: patch.diff
Description: Text document

Attachment: patch.diff.sig
Description: Binary data


reply via email to

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