<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>visophyte: data made shiny</title>
	<atom:link href="http://www.visophyte.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.visophyte.org/blog</link>
	<description>visualizing things with python</description>
	<pubDate>Wed, 09 Jul 2008 01:14:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>gloda&#8217;s first (primitive) visualization</title>
		<link>http://www.visophyte.org/blog/2008/07/08/glodas-first-primitive-visualization/</link>
		<comments>http://www.visophyte.org/blog/2008/07/08/glodas-first-primitive-visualization/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 01:14:49 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[Email]]></category>

		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Thunderbird]]></category>

		<category><![CDATA[Visualizing]]></category>

		<category><![CDATA[expmess]]></category>

		<category><![CDATA[gloda]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/?p=110</guid>
		<description><![CDATA[
A primitive visualization augments the gloda &#8220;other messages by author&#8221; listing by showing the messages sent by the author over time.  Messages are stacked by day.  The currently selected message is in darkest blue and also very wide.  Other messages from the same thread/conversation are in lighter blue and less wide.  Messages not in the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-111" title="gloda-m2pre-prim-timeline-vis" src="http://www.visophyte.org/blog/wp-content/uploads/2008/07/gloda-m2pre-prim-timeline-vis.png" alt="Author activity over time, current thread in blue, selected message in darkest blue." width="312" height="248" /></p>
<p>A primitive visualization augments the gloda &#8220;other messages by author&#8221; listing by showing the messages sent by the author over time.  Messages are stacked by day.  The currently selected message is in darkest blue and also very wide.  Other messages from the same thread/conversation are in lighter blue and less wide.  Messages not in the conversation are light grey and rather narrow.</p>
<p>It&#8217;s not clickable, it lacks any form of scale or any feedback at all, and there are scaling issues.  (If anyone wants to save me the effort of figuring out how to get the canvas to maintain a 1:1 pixel mapping to the actual display and still &#8216;flex&#8217; by adding/losing pixels, please do drop me a message or leave a comment.)  These will all change, but not yet.</p>
<p>I&#8217;ve pushed the changes to the mercurial repos and updated the stable tag, but I&#8217;m not publishing updated xpi&#8217;s, so you&#8217;ll need to roll your own if you care.  (The DB schema has not changed and so does not need to be blown away.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/07/08/glodas-first-primitive-visualization/feed/</wfw:commentRss>
		</item>
		<item>
		<title>gloda milestone 1</title>
		<link>http://www.visophyte.org/blog/2008/07/07/gloda-milestone-1/</link>
		<comments>http://www.visophyte.org/blog/2008/07/07/gloda-milestone-1/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 05:38:58 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Thunderbird]]></category>

		<category><![CDATA[gloda expmess]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/?p=108</guid>
		<description><![CDATA[
I am declaring milestone 1 of gloda (the global database extension for Thunderbird 3.x) / expmess (the experimental message view extension for Thunderbird 3.x) reached.  Milestone 1 basically consists of:

It statically indexes all of your folders.  It does not track changes made to your mailboxes.  It will become confused and angry as time goes on [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-109" title="gloda m1 indexing stuff" src="http://www.visophyte.org/blog/wp-content/uploads/2008/07/gloda-m1-indexing.png" alt="gloda m1 getting its indexing on" width="301" height="121" /></p>
<p>I am declaring milestone 1 of gloda (the global database extension for Thunderbird 3.x) / expmess (the experimental message view extension for Thunderbird 3.x) reached.  Milestone 1 basically consists of:</p>
<ul>
<li>It <strong>statically</strong> indexes all of your folders.  It <strong>does not</strong> track changes made to your mailboxes.  It will become confused and angry as time goes on and your message stores change but it stays the same.  Thankfully, it is also passive aggressive and will merely stop doing useful things rather than trying to eat your data.  It also refuses to change its ways; if you try and trick it into indexing a message it has already processed but you moved, it will not update the message&#8217;s index.  You can, however, trick it into indexing new messages.</li>
<li>The indexing sorta happens in the background and has pretty, if dubious from an UX perspective, progress bars (see screenshot).  This was stolen from M3, making M1 wildly more usable than originally planned.  At least on my computer, I didn&#8217;t notice much performance impact from the indexing, but my system is arguably fairly beefy.  This can all be tweaked though, especially once we hook the nsIIdleService in.</li>
<li>It adds a &#8220;data mine&#8221; pane to the right side of the message window.  It has a splitter so you can hide it if you want, but you can never be rid of it.  The data mine shows you the other messages in the current thread and other messages sent by the author&#8230; globally!</li>
<li>If you double-click on a message in the &#8220;data mine&#8221; added by expmess, it will take you there!  This is stolen from M2.</li>
<li>It will print out a lot of debug on standard out.  It used to print more.</li>
</ul>
<p>Having said all that, you can get the XPI&#8217;s here <strong>if you are using Thunderbird/Shredder 3.0a2pre or later</strong>, <strong>and your build is from July 5th 2008 or later</strong>.  You need to install both of them if you want anything interesting to happen.  The easiest way to do this is go to &#8220;Tools&#8221;&#8230;&#8221;Add-ons&#8221; in Shredder, and drag the links into the add-ons pane, at which point it will prompt you and such.  These extensions will not auto-update.</p>
<ul>
<li><a href="http://clicky.visophyte.org/files/momo/gloda/gloda-0.0-m1.xpi">gloda m1.xpi</a></li>
<li><a href="http://clicky.visophyte.org/files/momo/expmess/expmess-0.0-m1.xpi">expmess m1.xpi</a></li>
</ul>
<p>And the code (in mercurial) is here:</p>
<ul>
<li><a href="http://hg.mozilla.org/users/bugmail_asutherland.org/gloda/">gloda</a></li>
<li><a href="http://hg.mozilla.org/users/bugmail_asutherland.org/expmess/">expmess</a></li>
</ul>
<p>Because of the static indexing, you will probably want to install this extension, mention something about needing to wear sunglasses because of the brightness of the future, and then uninstall it.</p>
<p>Un-installation consists of:</p>
<ol>
<li>Disable / remove the gloda and expmess extensions.</li>
<li>Delete the <em>global-messages-db.sqlite</em> file from your profile directory.  Or don&#8217;t.  It&#8217;s up to you.</li>
</ol>
<p>I&#8217;ll be following this post up with a newsgroup post on mozilla.dev.apps.thunderbird on Monday with more details about planning out the rest of the milestones, as well as the arbitrary changes I had made to my (always tenative) milestone 1 plan.  Discussion about the global database is probably best directed to the newsgroup, but feel free to post comments here if you want too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/07/07/gloda-milestone-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>thunderbird global database m1-ish</title>
		<link>http://www.visophyte.org/blog/2008/07/05/thunderbird-global-database-m1-ish/</link>
		<comments>http://www.visophyte.org/blog/2008/07/05/thunderbird-global-database-m1-ish/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 05:15:34 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Thunderbird]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/?p=106</guid>
		<description><![CDATA[The &#8216;gloda&#8217; (global database) and &#8216;expmess&#8217; (experimental message view) Thunderbird extensions are nearly to milestone 1&#8230;

The screenshot scenario is that we have 2 months of apache-dev archives in two separate folders, July and August.  We have a message selected in the month of July, yet the &#8216;data mine&#8217; to the right is able to show [...]]]></description>
			<content:encoded><![CDATA[<p>The &#8216;gloda&#8217; (global database) and &#8216;expmess&#8217; (experimental message view) Thunderbird extensions are nearly to milestone 1&#8230;</p>
<p><a href="http://www.visophyte.org/blog/wp-content/uploads/2008/07/gloda-m1ish.png"><img class="alignnone size-full wp-image-107" title="gloda-m1ish" src="http://www.visophyte.org/blog/wp-content/uploads/2008/07/gloda-m1ish.png" alt="Thunderbird with gloda/expmess plugins m1-ish installed" /></a></p>
<p>The screenshot scenario is that we have 2 months of apache-dev archives in two separate folders, July and August.  We have a message selected in the month of July, yet the &#8216;data mine&#8217; to the right is able to show the messages in the thread spanning both months (and therefore folders), as well as showing all the other messages sent by the author spanning both months (and therefore folders).</p>
<p>I&#8217;ll post again with some links and what not once I hit the actual milestone 1.  Be aware that every-day usability is targeted for milestone 3, but that should still happen pre-summit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/07/05/thunderbird-global-database-m1-ish/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Someone created a Thread Arc vis for Thunderbird!</title>
		<link>http://www.visophyte.org/blog/2008/05/27/someone-created-a-thread-arc-vis-for-thunderbird/</link>
		<comments>http://www.visophyte.org/blog/2008/05/27/someone-created-a-thread-arc-vis-for-thunderbird/#comments</comments>
		<pubDate>Tue, 27 May 2008 13:55:13 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[External]]></category>

		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Thunderbird]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/?p=105</guid>
		<description><![CDATA[Alexander C. Hubmann-Haidvogel has created a Thread Arc visualization extension for Thunderbird!  Get info on the extension with some pretty pictures or just go straight for the extension at AMO.  Thanks to David Ascher for the heads up.
]]></description>
			<content:encoded><![CDATA[<p>Alexander C. Hubmann-Haidvogel has created a <a href="http://www.research.ibm.com/remail/threadarcs.html">Thread Arc</a> visualization extension for Thunderbird!  Get <a href="http://www.student.tugraz.at/ahubmann/threadvis/en/about.html">info on the extension with some pretty pictures</a> or just go straight for the <a href="https://addons.mozilla.org/en-US/thunderbird/addon/6533">extension at AMO</a>.  Thanks to <a href="http://ascher.ca/blog/">David Ascher</a> for the heads up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/05/27/someone-created-a-thread-arc-vis-for-thunderbird/feed/</wfw:commentRss>
		</item>
		<item>
		<title>pecobro, the tell-you-who-reads/writes-what performance code browser</title>
		<link>http://www.visophyte.org/blog/2008/05/20/pecobro-the-tell-you-who-readswrites-what-performance-code-browser/</link>
		<comments>http://www.visophyte.org/blog/2008/05/20/pecobro-the-tell-you-who-readswrites-what-performance-code-browser/#comments</comments>
		<pubDate>Tue, 20 May 2008 12:36:47 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[Debugging]]></category>

		<category><![CDATA[Program Execution]]></category>

		<category><![CDATA[Thunderbird]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/?p=104</guid>
		<description><![CDATA[No cool pictures, but I&#8217;ve enhanced and exposed the global reader/writer understanding of javascript code.  In other words, pecobro now does a passable job at telling you what global variables a given javascript file reads from/writes to, and who else writes to/reads from those variables.  False negatives are expected (don&#8217;t rely on things to be [...]]]></description>
			<content:encoded><![CDATA[<p>No cool pictures, but I&#8217;ve enhanced and exposed the global reader/writer understanding of javascript code.  In other words, pecobro now does a passable job at telling you what global variables a given javascript file reads from/writes to, and who else writes to/reads from those variables.  False negatives are expected (don&#8217;t rely on things to be exhaustive), and false positives are quite conceivable.</p>
<p>As an example starting point, take a look at messageWindow.js&#8217;s <a href="http://clicky.visophyte.org/examples/pecobro/20080520-01/index.xml#file=messageWindow_js.xml|overview=overview.svg|mtab=2">global reads</a> or <a href="http://clicky.visophyte.org/examples/pecobro/20080520-01/index.xml#file=messageWindow_js.xml|overview=overview.svg|mtab=3">global writes</a>.  From either of these you can click on other files in the sidebar to go to them.  There is no execution trace, so the overview diagram won&#8217;t be any help.  Be sure you have some free memory available and won&#8217;t try and hurt me if Firefox does something crazy.  Note: for long documents, some delay is expected as it attempts to apply various fix-ups.  Also note: clicking on things in the global reads/global writes tab won&#8217;t get you anywhere for now.</p>
<p>A quick example of a global read from that file (and who writes to that global):</p>
<p><strong>gDBView</strong></p>
<ul>
<li>Top Level: commandglue.js</li>
<li>Function: ClearThreadPane (in commandglue.js)</li>
<li>Function: CreateBareDBView (in commandglue.js)</li>
<li>Function: RerootFolder (in commandglue.js)</li>
<li>Function: SwitchView (in commandglue.js)</li>
<li>Function: openFolderTab (in mailWindowOverlay.js)</li>
<li>Function: setMailTabState (in mailWindowOverlay.js)</li>
<li>Function: restorePreSearchView (in searchBar.js)</li>
<li>Function: MsgGroupBySort (in threadPane.js)</li>
</ul>
<p>A quick example of a global write from that file (and who reads from that global):</p>
<p><strong>SelectFolder</strong></p>
<ul>
<li>Function: OpenMessageByHeader (in mailContextMenus.js)</li>
<li>Function: OpenInboxForServer (in mailWindow.js)</li>
<li>Function: selectFolder (in mailWindow.js)</li>
<li>Function: openFolderTab (in mailWindowOverlay.js)</li>
<li>Function: LoadNavigatedToMessage (in messageWindow.js)</li>
<li>Function: LoadNavigatedToMessage (in msgMail3PaneWindow.js)</li>
<li>Function: OnLocationTreeSelect (in msgMail3PaneWindow.js)</li>
<li>Function: SelectServer (in msgMail3PaneWindow.js)</li>
<li>Function: loadStartFolder (in msgMail3PaneWindow.js)</li>
<li>Function: RenameFolder (in widgetglue.js)</li>
<li>Function: loadInboxForNewAccount (in accountUtils.js)</li>
<li>Function: DropOnFolderTree (in messengerdnd.js)</li>
<li>Function: CrossFolderNavigation (in msgViewNavigation.js)</li>
</ul>
<p>The code, as always, is available at <a href="http://hg.mozilla.org/users/bugmail_asutherland.org/pecobro/">http://hg.mozilla.org/users/bugmail_asutherland.org/pecobro/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/05/20/pecobro-the-tell-you-who-readswrites-what-performance-code-browser/feed/</wfw:commentRss>
		</item>
		<item>
		<title>master control pecobro, the overkill performance code browser</title>
		<link>http://www.visophyte.org/blog/2008/05/03/master-control-pecobro-the-overkill-performance-code-browser/</link>
		<comments>http://www.visophyte.org/blog/2008/05/03/master-control-pecobro-the-overkill-performance-code-browser/#comments</comments>
		<pubDate>Sat, 03 May 2008 07:30:12 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[Debugging]]></category>

		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Program Execution]]></category>

		<category><![CDATA[Visualizing]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/?p=100</guid>
		<description><![CDATA[
The title isn&#8217;t true yet, but it&#8217;s disturbingly almost-true.  Pecobro&#8217;s hackish underpinnings have been &#8220;accidentally&#8221; replaced with surprisingly forward-looking code capable of supporting a much fancier feature set.  (I didn&#8217;t mean to, but I got tricked because the incremental cost to doing the &#8216;right thing&#8217; was always so low.)
The trace that you can see here, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-101" title="pecobro-01" src="http://www.visophyte.org/blog/wp-content/uploads/2008/05/pecobro-01.png" alt="" /></p>
<p>The title isn&#8217;t true yet, but it&#8217;s disturbingly almost-true.  Pecobro&#8217;s hackish underpinnings have been &#8220;accidentally&#8221; replaced with surprisingly forward-looking code capable of supporting a much fancier feature set.  (I didn&#8217;t mean to, but I got tricked because the incremental cost to doing the &#8216;right thing&#8217; was always so low.)</p>
<p>The trace that <a href="http://clicky.visophyte.org/examples/pecobro/20080503-01/index.xml">you can see here, by clicking on any of this text what has coloring</a> (and using firefox 3 in a session that you don&#8217;t mind if it crashes), is of running <a href="http://ccgi.standard8.plus.com/blog/">Mark Banner (Standard8)</a>&#8217;s Thunderbird bloatTest on OS X with DTrace probes enabled, but without actually doing the bloat testing.  So Thunderbird starts up, opens the address book, closes it, opens the compose window, closes it, and then quits.</p>
<p><a href="http://clicky.visophyte.org/examples/pecobro/20080503-02/index.xml">Here is a preliminary processed trace</a> from a run triggering <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=296453">bug 296453</a>.  Be forewarned that there is some missing information from the underlying trace and so it&#8217;s not all that it could be.  I think the XPConnect probes need to be fleshed out slightly more (and processed).</p>
<p>The code (both pecobro and mozilla codebase patches) is at: <a href="http://hg.mozilla.org/users/bugmail_asutherland.org/">http://hg.mozilla.org/users/bugmail_asutherland.org/</a></p>
<p><img class="alignnone size-full wp-image-102" title="pecobro-02" src="http://www.visophyte.org/blog/wp-content/uploads/2008/05/pecobro-02.png" alt="" /></p>
<p>What crazy overkill things can pecobro do now?</p>
<ul>
<li>Parse all of the javascript code used in Thunderbird, including nearly all (maybe all?) of the 1.x enhancements.  The parser is still a bit hackish, especially when it comes to support of regexes, but it actually parses things.  Thanks to Chris Lambrou for posting his initial JavaScript.g antlr3 grammar (and BSD licensing it) that I used as a basis for my hacky version.  This was certainly a learning experience; I now know that javascript can never replace python in my heart&#8230;</li>
<li>Find all of the places functions can be defines in javascript code and do a pretty good job at figuring out reasonable names for them.  This even includes &#8220;<em>(</em>new<em>)?</em> Function()&#8221;.  This allows us to use the function-info DTrace probes to use line number information to identify functions.  We do this so that we can identify anonymous functions.</li>
<li>Handle XBL as well as we handle pure-javascript files.  (Parsing/AST fix-ups/syntax highlighting with AST traversal/etc.)</li>
<li>Parse/interpret disturbingly large portions of makefiles.  Sure, it ignores the rules, and I&#8217;ve only implemented the functions I require, but it does all the conditional and include stuff with variable expansion, including some key functions like foreach/filter/etc.</li>
<li>Parse jar manifests sufficiently well to figure out what file ends up at what chrome path.</li>
<li>Cache its javascript parse results at both the AST and (sorta-semantic) processing level, among other things.  Hooray for <a href="http://home.gna.org/oomadness/en/cerealizer/index.html">cerealizer</a> which dares persist/de-persist that which pickle dare not.  (Nested classes.)  (Note: We don&#8217;t cache XBL stuff yet, and the ASTs are large enough that de-persisting them can be quite perceptible.)</li>
</ul>
<p><img class="alignnone size-full wp-image-103" title="pecobro-03" src="http://www.visophyte.org/blog/wp-content/uploads/2008/05/pecobro-03.png" alt="" /></p>
<p>What is not crazy, but still nice:</p>
<ul>
<li>The traces are now much more reliable thanks to modifications to the Mozilla USDT probes to provide sufficient information for us to distinguish between JavaScript execution contexts (namely, JSContext).  Modifications were also made to avoid the &#8216;guessing&#8217;/ghost value problems that happen when native functions were called.</li>
<li>A foolish bug in the sparkbar calculation has been fixed.  aka &#8220;Now With Accuracy&#8221;!</li>
<li>If a function in a trace called another function or was called by another function, this will be displayed inline in the source display.</li>
<li>Infer &#8216;native&#8217; functions (with the above additional modifications to the Mozilla USDT probes), assigning them to an object.  This ends up being Object, ChromeWindow, or other native Class type.  Some of this may be mooted by getting the XPConnect probes reliably in the mix.</li>
</ul>
<p>What doesn&#8217;t it do?</p>
<ul>
<li>Add the XPConnect js_Invoke probes; I punted on that because that was turning out to be difficult to get right.</li>
<li>It ignores .xul files for now.  Although xul files primarily appears in a caller context (as told by function-info probes), they can also be a callee when someone pulls a fast one and inlines some simple code in a script tag.  We brutally mis-attribute the call to the previous function when this happens.  This will eventually get resolved because we will need to understand .xul files for namespace reasons.  Also, people sound like they&#8217;re interested in who overlays what and the like, and that&#8217;s sorta right up our alley thanks to all the overkill stuff we do.</li>
<li>Exhaustively determine reads from/contributions to the &#8216;global&#8217; (window or what not) namespace/scope.  The groundwork is there in terms of understanding the contribution of top-level statements to the namespace or its reads from it, but we don&#8217;t traverse into functions.</li>
<li>Associate functions with an object/type (ignoring the native function case).  This requires more semantic understanding.</li>
<li>Clicking on functions still doesn&#8217;t do anything.  I disabled that before my first post on pecobro due to firefox-crashing issues, and still haven&#8217;t gotten around to resolving it.</li>
<li>A usable overview visualization.  The overview diagram has become cluttered by the presence of so many &#8216;relevant&#8217; (touched) files.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/05/03/master-control-pecobro-the-overkill-performance-code-browser/feed/</wfw:commentRss>
		</item>
		<item>
		<title>pecobro: the performance code browser (early stage)</title>
		<link>http://www.visophyte.org/blog/2008/04/08/pecobro-the-performance-code-browser-early-stage/</link>
		<comments>http://www.visophyte.org/blog/2008/04/08/pecobro-the-performance-code-browser-early-stage/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 09:31:59 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Program Execution]]></category>

		<category><![CDATA[Thunderbird]]></category>

		<category><![CDATA[Visualizing]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/?p=96</guid>
		<description><![CDATA[
At the beginning of last week, I had gotten dtrace working on a Mac Mini using the Mozilla javascript-provider probes.  Very cool stuff, but it left me with several questions about what would really be best to do next:

How do I best understand what I&#8217;m seeing?  (Most of the codebase is brand new to me&#8230;)
How [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-97" title="example syntax-highlighted code with sparkbar" src="http://www.visophyte.org/blog/wp-content/uploads/2008/04/code-highlighted-header-sparkbar.png" alt="" width="500" height="85" /></p>
<p>At the beginning of <a href="http://www.visophyte.org/blog/2008/03/31/mozilla-javascript-dtrace-probes-visichron-style/">last week</a>, I had gotten dtrace working on a Mac Mini using the Mozilla javascript-provider probes.  Very cool stuff, but it left me with several questions about what would really be best to do next:</p>
<ul>
<li>How do I best understand what I&#8217;m seeing?  (Most of the codebase is brand new to me&#8230;)</li>
<li>How do I share the data with others in a way that is both comprehensible and allows them to draw their own conclusions from the data?</li>
<li>What can I do to reduce the effort required to work on performance problems?</li>
</ul>
<p>I was tempted to just try and just dig into the system so I could have something to show immediately, but I knew it would still take a while to see the big picture just using an editor/ctags/lxr/opengrok, even informed by dtrace.  And even then, that big picture doesn&#8217;t scale well; whatever picture I managed to formulate would be stuck inside my head&#8230;</p>
<p><img class="aligncenter size-full wp-image-98" title="overview-svg-cropped-indexed" src="http://www.visophyte.org/blog/wp-content/uploads/2008/04/overview-svg-cropped-indexed.png" alt="" width="500" height="333" /></p>
<p>So my solution was to try and build a tool that could help me accomplish my short-term goals soon, and have the potential to grow into a usable solution to all of the above&#8230; eventually.  The goal, in a nutshell, is to provide a code browser for javascript that is able to integrate performance information (retrieved from traces) alongside the code.  Seeing that lxr/mxr and opengrok didn&#8217;t understand javascript or XBL all that well, it also seemed feasible to try and improve on their browsing capabilities for javascript.  A far-down-the-road goal is also to be able to pull in information from the underlying C++ code as well, potentially leveraging dehydra, etc.  (This would primarily be for understanding what happens when we leave the javascript layer, not trying to be the same solution for C++ space.)</p>
<p>So what can it do so far?  You can <a href="http://clicky.visophyte.org/examples/pecobro/20080408-01/index.xml">go try it for yourself if you like</a> as long as you keep your expectations very low and realize the current state does not reflect all of the bullet points below.  Also, you probably want firefox 3.0.  Or you can read my bullet points:</p>
<ul>
<li>Parse custom DTrace script output!  The Mozilla DTrace probe points could probably use a little love to improve what we are able to get out.  Also, I think it&#8217;s betraying us somewhere.</li>
<li>Parse JavaScript! Sorta!  (I hacked in support for the regular expression syntax, but I haven&#8217;t corrected the ambiguity with division, so things with division break.  Also, there&#8217;s at least one or two other glitches that cause early termination.) [Yay antlr!]</li>
<li>Parse XBL!  Even with entity inlining!  Even when people put #ifdefs in the XML document! Sorta!  We don&#8217;t actually do anything intelligent with the XBL right now or with its JavaScript, but it won&#8217;t take much to get that much improved. [Yay elementtree!]</li>
<li>Visualize some stuff!  Inter-file relationship graph in the overview.  In the code and &#8216;Funcs&#8217; sidebar tab you get a sparkbar where each bar represents a time interval.  The height of the par is the percentage of possible time we could have spent in that time interval.  Red means we belive that time was spent in the function itself, green means we think we spent that time in calls to other functions. [Yay visophyte!]</li>
<li>Navigate with history!  Click on the overview graph and you go to things.  Click on the file names in the &#8216;Files&#8217; list and you go to the files.  I tried to make it so you could click on function names in the side bars to go to them, but jquery.scrollTo and/or firefox 3.0b5 had serious crashing issues.  [Yay jquery, jquery.history!]</li>
<li>See syntax-highlighted code with random headings intertwined (shows the parser worked) and potentially a visualization.  [Yay pygments!]</li>
</ul>
<p><img class="aligncenter size-full wp-image-99" title="sidebar-funcs-with-sparkbar" src="http://www.visophyte.org/blog/wp-content/uploads/2008/04/sidebar-funcs-with-sparkbar.png" alt="" width="191" height="164" /></p>
<p>My hope in the near-term is to fix the outright bugs (parsing issues), get XBL going, and then augment the function information with more trace-derived data including more traditional call-stacks, etc.  Then the tool should be sufficiently usable that my immediate focus can change to creating automated tests to actually gather performance/execution traces so we can use the tool for what I started it for.  This may also get shelved for a while if it turns out that we need action (patches) immediately.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/04/08/pecobro-the-performance-code-browser-early-stage/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mozilla JavaScript DTrace Probes, visichron style</title>
		<link>http://www.visophyte.org/blog/2008/03/31/mozilla-javascript-dtrace-probes-visichron-style/</link>
		<comments>http://www.visophyte.org/blog/2008/03/31/mozilla-javascript-dtrace-probes-visichron-style/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 11:24:39 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Program Execution]]></category>

		<category><![CDATA[Visualizing]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/2008/03/31/mozilla-javascript-dtrace-probes-visichron-style/</guid>
		<description><![CDATA[ 
This visualization is the result of an adapted visichron.py script (from my chronicle-recorder &#8216;chroniquery&#8217; bindings) run against the output of a custom DTrace script (using the Mozilla JS providers) on OS X.  It&#8217;s a proof-of-possibility rather than anything immediately useful.
The differences from the last visichron post (using chronicle-recorder as a back-end) are:

Node hues are distinct [...]]]></description>
			<content:encoded><![CDATA[<p> <img src="http://www.visophyte.org/blog/wp-content/uploads/2008/03/dtrace-calendar-ipsep-snippet.png" alt="dtrace javascript snippet" /></p>
<p>This visualization is the result of an adapted visichron.py script (from my chronicle-recorder &#8216;chroniquery&#8217; bindings) run against the output of a custom DTrace script (using the Mozilla JS providers) on OS X.  It&#8217;s a proof-of-possibility rather than anything immediately useful.</p>
<p>The differences from the last visichron post (using chronicle-recorder as a back-end) are:</p>
<ul>
<li>Node hues are distinct based on the file the javascript was executed from.  (Saturation still varies with amount of time spent in the function.)</li>
<li>Graph layout is done using graphviz&#8217;s neato&#8217;s &#8220;ipsep&#8221; (experimental) mode.  This works fantastically well at reducing/eliminating overlap.  Having said that, a hierarchical layout may make more sense.</li>
<li>Ring colors are based on call depth (so redundantly encoded with the ring radius) rather than any knowledge about the control-flow.  Full control-flow information is not readily available and would be extremely expensive, but we could provide at least some degree of approximation using the calls made by the function as indicators.  Of course, the ring visualization at this point and for this purpose is probably better represented as non-nested (side-by-side rings of different radii; not containing each other) faux-continuous ring slices with transparency varying by amount of time spent in the function at that call-depth.  This would simplify the object model, allowing for non-insane use of the SVG backend and interactivity enhancements.</li>
</ul>
<p><a href="http://www.visophyte.org/blog/wp-content/uploads/2008/03/dtrace-calendar-ipsep-honking-big-indexed.png" title="scaled indexed"><img src="http://www.visophyte.org/blog/wp-content/uploads/2008/03/dtrace-calendar-ipsep-honking-big-scaled-indexed.png" alt="scaled indexed" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/03/31/mozilla-javascript-dtrace-probes-visichron-style/feed/</wfw:commentRss>
		</item>
		<item>
		<title>status/future fyi. no pictures.</title>
		<link>http://www.visophyte.org/blog/2008/03/09/statusfuture-fyi-no-pictures/</link>
		<comments>http://www.visophyte.org/blog/2008/03/09/statusfuture-fyi-no-pictures/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 22:32:23 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[Meta]]></category>

		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Thunderbird]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/2008/03/09/statusfuture-fyi-no-pictures/</guid>
		<description><![CDATA[I have accepted a position at Mozilla Messaging and will start at the end of March.  Posting has been rare as of late and will be rare until then because my spare cycles are being given over to providing closure to my day-job projects, dealing with various hardware failures, and other small fires.
Hobby-wise, this [...]]]></description>
			<content:encoded><![CDATA[<p>I have accepted a position at <a href="http://www.mozillamessaging.com/">Mozilla Messaging</a> and will start at the end of March.  Posting has been rare as of late and will be rare until then because my spare cycles are being given over to providing closure to my day-job projects, dealing with various hardware failures, and other small fires.</p>
<p>Hobby-wise, this will translate into a focus on visualizing e-mail from within Thunderbird.  My nascent Python library, visophyte, will likely have a JavaScript sibling, but will not be abandoned.</p>
<p>Job-wise, I expect to focus on improving Thunderbird for both users and extension developers.  Although my interest in creating a useful visualization extension will inform my efforts, it will not be my focus.  Which is to say, do not worry that I will be engaging in flights of fancy and neglecting the core of Thunderbird.  However, do be happy that good visualizations will depend on non-trivial data analysis and snappy, interactive behaviour and that this should translate into good things for Thunderbird, even if you don&#8217;t like shiny things.</p>
<p>It wasn&#8217;t an easy decision to leave my current employer (I have only great things to say about <a href="http://www.theptrgroup.com/">The PTR Group</a>; check them out if you&#8217;re in the greater DC metro area), but Mozilla Messaging is an exceedingly rare opportunity that I could not pass up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/03/09/statusfuture-fyi-no-pictures/feed/</wfw:commentRss>
		</item>
		<item>
		<title>chronicle-recorder and amd64, hooray!</title>
		<link>http://www.visophyte.org/blog/2008/01/27/chronicle-recorder-and-amd64-hooray/</link>
		<comments>http://www.visophyte.org/blog/2008/01/27/chronicle-recorder-and-amd64-hooray/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 07:59:15 +0000</pubDate>
		<dc:creator>Andrew Sutherland</dc:creator>
		
		<category><![CDATA[Debugging]]></category>

		<category><![CDATA[Program Execution]]></category>

		<category><![CDATA[Visualizing]]></category>

		<guid isPermaLink="false">http://www.visophyte.org/blog/2008/01/27/chronicle-recorder-and-amd64-hooray/</guid>
		<description><![CDATA[ 
My personal laptop rolls amd64-style (rather than i686), and chronicle-recorder&#8217;s valgrind component was not working on it (&#8221;illegal instruction&#8221;).  I have done some vendor-branch dancing to get chronicle-recorder&#8217;s valgrind sub-directory to use valgrind 3.3.0.  A bzr branch of just the valgrind subdirectory (drop-in or build separately and make sure you invoke valgrind [...]]]></description>
			<content:encoded><![CDATA[<p> <a href="http://www.visophyte.org/blog/wp-content/uploads/2008/01/python-hello-world-visichron-3deep.png" title="visichron.py against python 'hello world'"><img src="http://www.visophyte.org/blog/wp-content/uploads/2008/01/python-hello-world-visichron-3deep-cropped.png" alt="overview: visichron.py trace python -f main -d 3" /></a></p>
<p>My personal laptop rolls amd64-style (rather than i686), and chronicle-recorder&#8217;s valgrind component was not working on it (&#8221;illegal instruction&#8221;).  I have done some vendor-branch dancing to get chronicle-recorder&#8217;s valgrind sub-directory to use valgrind 3.3.0.  A bzr branch of <strong>just the valgrind subdirectory</strong> (drop-in or build separately and make sure you invoke valgrind from that location) is available here: <a href="http://www.visophyte.org/rev_control/bzr/valgrind-chronicle/valgrind-chronicle/">http://www.visophyte.org/rev_control/bzr/valgrind-chronicle/valgrind-chronicle/</a></p>
<p>A probably faster location to bzr branch from is here: <a href="http://clicky.visophyte.org/rev_control/bzr/valgrind-chronicle/valgrind-chronicle/">http://clicky.visophyte.org/rev_control/bzr/valgrind-chronicle/valgrind-chronicle/</a></p>
<p>and a tarball of the tip is here: <a href="http://www.visophyte.org/rev_control/tarballs/valgrind-chronicle-r6.tar.bz2">http://www.visophyte.org/rev_control/tarballs/valgrind-chronicle-r6.tar.bz2</a></p>
<p>I have also updated chroniquery (my python binding for chronicle-query&#8217;s JSON interface, and its own set of tools that build on it) to work with amd64.  Its bzr branch is here: <a href="http://www.visophyte.org/rev_control/bzr/chroniquery/trunk/">http://www.visophyte.org/rev_control/bzr/chroniquery/trunk/</a></p>
<p>The goal of all of this was to be able to run chronicle against Thunderbird, which I was able to do.  Unfortunately, visichron (the visualizing part of chroniquery using visophyte) is not quite ready for such an undertaking at this time.  (Not to mention a few C++ symbols issues&#8230;)</p>
<p><img src="http://www.visophyte.org/blog/wp-content/uploads/2008/01/python-hello-world-visichron-3deep-snippet.png" alt="snippet: visichron.py trace python -f main -d 3" /></p>
<p>However, it was powerful enough to handle visualizing the trace resulting from invoking python on a python file with just &#8220;print &#8216;hello world&#8217;&#8221; in it.  So that&#8217;s what you see here, albeit limited to only 3 call levels deep.  Click on the upper picture to see the whole thing at 2000&#215;2000, or just look on the lower picture to get an idea of what&#8217;s going on.  Just like my <a href="http://www.visophyte.org/blog/2007/09/03/chronicle-recorder-graphring-visualization-hooray/">first post using visichron</a>, the rings are colored based on a (naive) control-flow-taken basis.  The ring colors are per-function, however.  Also, the node colors are &#8216;hot&#8217; colored based on how many &#8216;ticks&#8217; were spent inside the functions, multiple counting for recursion.</p>
<p>Other interesting changes include some primitive watch functionality for chronisole&#8217;s &#8216;trace&#8217; mode.  Also, the previously unmentioned readchron.py now understands and prints BunchedEffect and RegEffect info.  (readchron aspires to be along the lines of readelf for chronicle databases, but with more colors.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.visophyte.org/blog/2008/01/27/chronicle-recorder-and-amd64-hooray/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
