1 2Type and Pointer Analysis to-do list 3==================================== 4 5Alan Donovan <adonovan@google.com> 6 7 8Overall design 9-------------- 10 11We should re-run the type and pointer analyses periodically, 12as we do with the indexer. 13 14Version skew: how to mitigate the bad effects of stale URLs in old pages? 15We could record the file's length/CRC32/mtime in the go/loader, and 16refuse to decorate it with links unless they match at serving time. 17 18Use the VFS mechanism when (a) enumerating packages and (b) loading 19them. (Requires planned changes to go/loader.) 20 21Future work: shard this using map/reduce for larger corpora. 22 23Testing: how does one test that a web page "looks right"? 24 25 26Bugs 27---- 28 29(*ssa.Program).Create requires transitively error-free packages. We 30can make this more robust by making the requirement transitively free 31of "hard" errors; soft errors are fine. 32 33Markup of compiler errors is slightly buggy because they overlap with 34other selections (e.g. Idents). Fix. 35 36 37User Interface 38-------------- 39 40CALLGRAPH: 41- Add a search box: given a search node, expand path from each entry 42 point to it. 43- Cause hovering over a given node to highlight that node, and all 44 nodes that are logically identical to it. 45- Initially expand the callgraph trees (but not their toggle divs). 46 47CALLEES: 48- The '(' links are not very discoverable. Highlight them? 49 50Type info: 51- In the source viewer's lower pane, use a toggle div around the 52 IMPLEMENTS and METHODSETS lists, like we do in the package view. 53 Only expand them initially if short. 54- Include IMPLEMENTS and METHOD SETS information in search index. 55- URLs in IMPLEMENTS/METHOD SETS always link to source, even from the 56 package docs view. This makes sense for links to non-exported 57 types, but links to exported types and funcs should probably go to 58 other package docs. 59- Suppress toggle divs for empty method sets. 60 61Misc: 62- The [X] button in the lower pane is subject to scrolling. 63- Should the lower pane be floating? An iframe? 64 When we change document.location by clicking on a link, it will go away. 65 How do we prevent that (a la Gmail's chat windows)? 66- Progress/status: for each file, display its analysis status, one of: 67 - not in analysis scope 68 - type analysis running... 69 - type analysis complete 70 (+ optionally: there were type errors in this file) 71 And if PTA requested: 72 - type analysis complete; PTA not attempted due to type errors 73 - PTA running... 74 - PTA complete 75- Scroll the selection into view, e.g. the vertical center, or better 76 still, under the pointer (assuming we have a mouse). 77 78 79More features 80------------- 81 82Display the REFERRERS relation? (Useful but potentially large.) 83 84Display the INSTANTIATIONS relation? i.e. given a type T, show the set of 85syntactic constructs that can instantiate it: 86 var x T 87 x := T{...} 88 x = new(T) 89 x = make([]T, n) 90 etc 91 + all INSTANTIATIONS of all S defined as struct{t T} or [n]T 92(Potentially a lot of information.) 93(Add this to guru too.) 94 95 96Optimisations 97------------- 98 99Each call to addLink takes a (per-file) lock. The locking is 100fine-grained so server latency isn't terrible, but overall it makes 101the link computation quite slow. Batch update might be better. 102 103Memory usage is now about 1.5GB for GOROOT + go.tools. It used to be 700MB. 104 105Optimize for time and space. The main slowdown is the network I/O 106time caused by an increase in page size of about 3x: about 2x from 107HTML, and 0.7--2.1x from JSON (unindented vs indented). The JSON 108contains a lot of filenames (e.g. 820 copies of 16 distinct 109filenames). 20% of the HTML is L%d spans (now disabled). The HTML 110also contains lots of tooltips for long struct/interface types. 111De-dup or just abbreviate? The actual formatting is very fast. 112