{"id":104,"date":"2008-05-20T07:36:47","date_gmt":"2008-05-20T12:36:47","guid":{"rendered":"http:\/\/www.visophyte.org\/blog\/?p=104"},"modified":"2009-02-19T05:08:00","modified_gmt":"2009-02-19T10:08:00","slug":"pecobro-the-tell-you-who-readswrites-what-performance-code-browser","status":"publish","type":"post","link":"https:\/\/www.visophyte.org\/blog\/2008\/05\/20\/pecobro-the-tell-you-who-readswrites-what-performance-code-browser\/","title":{"rendered":"pecobro, the tell-you-who-reads\/writes-what performance code browser"},"content":{"rendered":"<p>No cool pictures, but I&#8217;ve enhanced and exposed the global reader\/writer understanding of javascript code.\u00a0 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.\u00a0 False negatives are expected (don&#8217;t rely on things to be exhaustive), and false positives are quite conceivable.<\/p>\n<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>.\u00a0 From either of these you can click on other files in the sidebar to go to them.\u00a0 There is no execution trace, so the overview diagram won&#8217;t be any help.\u00a0 Be sure you have some free memory available and won&#8217;t try and hurt me if Firefox does something crazy.\u00a0 Note: for long documents, some delay is expected as it attempts to apply various fix-ups.\u00a0 Also note: clicking on things in the global reads\/global writes tab won&#8217;t get you anywhere for now.<\/p>\n<p>A quick example of a global read from that file (and who writes to that global):<\/p>\n<p><strong>gDBView<\/strong><\/p>\n<ul>\n<li>Top Level: commandglue.js<\/li>\n<li>Function: ClearThreadPane (in commandglue.js)<\/li>\n<li>Function: CreateBareDBView (in commandglue.js)<\/li>\n<li>Function: RerootFolder (in commandglue.js)<\/li>\n<li>Function: SwitchView (in commandglue.js)<\/li>\n<li>Function: openFolderTab (in mailWindowOverlay.js)<\/li>\n<li>Function: setMailTabState (in mailWindowOverlay.js)<\/li>\n<li>Function: restorePreSearchView (in searchBar.js)<\/li>\n<li>Function: MsgGroupBySort (in threadPane.js)<\/li>\n<\/ul>\n<p>A quick example of a global write from that file (and who reads from that global):<\/p>\n<p><strong>SelectFolder<\/strong><\/p>\n<ul>\n<li>Function: OpenMessageByHeader (in mailContextMenus.js)<\/li>\n<li>Function: OpenInboxForServer (in mailWindow.js)<\/li>\n<li>Function: selectFolder (in mailWindow.js)<\/li>\n<li>Function: openFolderTab (in mailWindowOverlay.js)<\/li>\n<li>Function: LoadNavigatedToMessage (in messageWindow.js)<\/li>\n<li>Function: LoadNavigatedToMessage (in msgMail3PaneWindow.js)<\/li>\n<li>Function: OnLocationTreeSelect (in msgMail3PaneWindow.js)<\/li>\n<li>Function: SelectServer (in msgMail3PaneWindow.js)<\/li>\n<li>Function: loadStartFolder (in msgMail3PaneWindow.js)<\/li>\n<li>Function: RenameFolder (in widgetglue.js)<\/li>\n<li>Function: loadInboxForNewAccount (in accountUtils.js)<\/li>\n<li>Function: DropOnFolderTree (in messengerdnd.js)<\/li>\n<li>Function: CrossFolderNavigation (in msgViewNavigation.js)<\/li>\n<\/ul>\n<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>\n","protected":false},"excerpt":{"rendered":"<p>No cool pictures, but I&#8217;ve enhanced and exposed the global reader\/writer understanding of javascript code.\u00a0 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 &hellip; <a href=\"https:\/\/www.visophyte.org\/blog\/2008\/05\/20\/pecobro-the-tell-you-who-readswrites-what-performance-code-browser\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[7,8,6],"tags":[26],"class_list":["post-104","post","type-post","status-publish","format-standard","hentry","category-debugging","category-program-execution","category-thunderbird","tag-pecobro"],"_links":{"self":[{"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/posts\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":1,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":176,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/posts\/104\/revisions\/176"}],"wp:attachment":[{"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.visophyte.org\/blog\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}