Experimental support for HTML-export of profiler data

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Experimental support for HTML-export of profiler data

Daniel Kraft
Hi all!

As discussed with some members of the community in Darmstadt, I've been
working on a function that exports profiler data as a set of HTML files.

A first experimental version is attached.  To use it, do something like:

> profexport ("foo")
> profexport ("foo", "Some name")
> profexport ("foo", info-structure)

(See the help text for more details.)

This writes out a set of HTML files to the directory "foo".  There are
three "types" of files written:

1) index.html corresponds to the flat profile shown by "profshow" and is
intended as the starting point.

2) The files func-*.html contain information for all of the individual
functions and are accessible by clicking on the function names in the
flat profile.  This data is not directly accessible with the existing
profiler functions, and is basically what the info.FunctionTable contains.

3) The hierarchical profile is present in hierarchy-*.html, starting
with hierarchy-1.html as the top level.  This corresponds to what
"profexplore" shows.

Note that there is not yet any styling, and I'm also not sure about the
best way to link the files to each other; the current HTML templates are
only an initial suggestion.  Feedback is very welcome!

What do you think about this function, is (something like it) a good
addition to Octave's profiling functions?

There are also a few more questions I would appreciate input on:

1) Currently, there are no attempts to escape strings before writing out
as HTML (this is remarked as FIXME comments in the code).  Is there
already a general-purpose HTML-escape routine somewhere?  I'm not the
first to output HTML (package documentation, for instance).  Or should I
write the routine myself, it is probably straight-forward; a few strrep
calls for the characters <>"&' should suffice.

2) There's not yet any testing; I'm not sure how far the functionality
can be tested at all, but we could at least test creation of the output
directory and input parsing.  The same goes for demo.  Would it be ok to
create and possibly not delete a temporary directory with the profiling
stuff for the demo?

3) I've also got a few ideas for improving the information that the
profiler shows in general (based on the same raw data, but with more
analysis).  I'll work on that as a follow-up.

Yours,
Daniel

--
http://www.domob.eu/
OpenPGP: 1142 850E 6DFF 65BA 63D6  88A8 B249 2AC4 A733 0737
Namecoin: id/domob -> https://nameid.org/?name=domob
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri

profexport.m (10K) Download Attachment
signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

PING: Experimental support for HTML-export of profiler data

Daniel Kraft
Hi!

Any opinion to the patch below?  Should I open an issue on Savannah and
attach it there instead?

Yours,
Daniel

On 2015-11-08 14:10, Daniel Kraft wrote:

> Hi all!
>
> As discussed with some members of the community in Darmstadt, I've been
> working on a function that exports profiler data as a set of HTML files.
>
> A first experimental version is attached.  To use it, do something like:
>
>> profexport ("foo")
>> profexport ("foo", "Some name")
>> profexport ("foo", info-structure)
>
> (See the help text for more details.)
>
> This writes out a set of HTML files to the directory "foo".  There are
> three "types" of files written:
>
> 1) index.html corresponds to the flat profile shown by "profshow" and is
> intended as the starting point.
>
> 2) The files func-*.html contain information for all of the individual
> functions and are accessible by clicking on the function names in the
> flat profile.  This data is not directly accessible with the existing
> profiler functions, and is basically what the info.FunctionTable contains.
>
> 3) The hierarchical profile is present in hierarchy-*.html, starting
> with hierarchy-1.html as the top level.  This corresponds to what
> "profexplore" shows.
>
> Note that there is not yet any styling, and I'm also not sure about the
> best way to link the files to each other; the current HTML templates are
> only an initial suggestion.  Feedback is very welcome!
>
> What do you think about this function, is (something like it) a good
> addition to Octave's profiling functions?
>
> There are also a few more questions I would appreciate input on:
>
> 1) Currently, there are no attempts to escape strings before writing out
> as HTML (this is remarked as FIXME comments in the code).  Is there
> already a general-purpose HTML-escape routine somewhere?  I'm not the
> first to output HTML (package documentation, for instance).  Or should I
> write the routine myself, it is probably straight-forward; a few strrep
> calls for the characters <>"&' should suffice.
>
> 2) There's not yet any testing; I'm not sure how far the functionality
> can be tested at all, but we could at least test creation of the output
> directory and input parsing.  The same goes for demo.  Would it be ok to
> create and possibly not delete a temporary directory with the profiling
> stuff for the demo?
>
> 3) I've also got a few ideas for improving the information that the
> profiler shows in general (based on the same raw data, but with more
> analysis).  I'll work on that as a follow-up.
>
> Yours,
> Daniel
>

--
http://www.domob.eu/
OpenPGP: 1142 850E 6DFF 65BA 63D6  88A8 B249 2AC4 A733 0737
Namecoin: id/domob -> https://nameid.org/?name=domob
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri

profexport.m (10K) Download Attachment
signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PING: Experimental support for HTML-export of profiler data

Jordi Gutiérrez Hermoso-2
On Fri, 2015-11-20 at 15:14 +0100, Daniel Kraft wrote:
> Any opinion to the patch below? Should I open an issue on Savannah
> and attach it there instead?

I'm rather inclined to just give you push access to Savannah, if jwe
agrees. Your profiler code should be sufficient proof of your
abilities to treat our codebase nicely.

- Jordi G. H.



Reply | Threaded
Open this post in threaded view
|

Re: PING: Experimental support for HTML-export of profiler data

Daniel Kraft
Hi Jordi!

On 2015-11-20 20:48, Jordi Gutiérrez Hermoso wrote:
> On Fri, 2015-11-20 at 15:14 +0100, Daniel Kraft wrote:
>> Any opinion to the patch below? Should I open an issue on Savannah
>> and attach it there instead?
>
> I'm rather inclined to just give you push access to Savannah, if jwe
> agrees. Your profiler code should be sufficient proof of your
> abilities to treat our codebase nicely.

Of course, I won't oppose here. :)  In the current case, however, I
would love to get some feedback on the general format and function
interface.  I don't think it is yet fully ready to be pushed upstream.

If everyone thinks it is fine as it is, then I can, of course, just
polish the code according to my own ideas and later push it.

Yours,
Daniel

--
http://www.domob.eu/
OpenPGP: 1142 850E 6DFF 65BA 63D6  88A8 B249 2AC4 A733 0737
Namecoin: id/domob -> https://nameid.org/?name=domob
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri


signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PING: Experimental support for HTML-export of profiler data

ederag
Hi Daniel,

On Saturday, November 21, 2015 10:12:08 Daniel Kraft wrote:
>...
> Of course, I won't oppose here. :)  In the current case, however, I
> would love to get some feedback on the general format and function
> interface.  I don't think it is yet fully ready to be pushed upstream.
> ...

This is really a smart way to explore the profile data, thanks !
It is already working fine, and very useful.

The patch attached alternates rows background,
to make lines easier to follow.

Best regards,
Ederag

profexport_alternate_rows_15b22.diff (580 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PING: Experimental support for HTML-export of profiler data

Daniel Kraft
Hi!

On 2015-11-22 12:06, ederag wrote:
> On Saturday, November 21, 2015 10:12:08 Daniel Kraft wrote:
>> ...
>> Of course, I won't oppose here. :)  In the current case, however, I
>> would love to get some feedback on the general format and function
>> interface.  I don't think it is yet fully ready to be pushed upstream.
>> ...
>
> This is really a smart way to explore the profile data, thanks !
> It is already working fine, and very useful.

Thanks for the feedback and testing!

> The patch attached alternates rows background,
> to make lines easier to follow.

Thanks for the patch as well!  I just wonder if we should include
styling in the HTML template or instead with some CSS file.  This file
could be installed in a /usr/share location with Octave and be linked
from the HTML templates.  I think that Gnucash does this, for instance,
for its HTML reports.  What do others think?

Yours,
Daniel

--
http://www.domob.eu/
OpenPGP: 1142 850E 6DFF 65BA 63D6  88A8 B249 2AC4 A733 0737
Namecoin: id/domob -> https://nameid.org/?name=domob
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri


signature.asc (836 bytes) Download Attachment