Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4292)

Issue 40630043: code review 40630043: go.tools/oracle: improvements to command set and perfor... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 5 months ago by adonovan
Modified:
10 years, 5 months ago
Reviewers:
crawshaw1
CC:
crawshaw1, Dominik Honnef, golang-dev, gri
Visibility:
Public.

Description

go.tools/oracle: improvements to command set and performance. Command set: - what: an extremely fast query that parses a single file and returns the AST stack, package name and the set of query modes that apply to the current selection. Intended for GUI tools that need to grey out UI elements. - definition: shows the definition of an identifier. - pointsto: the PTA features of 'describe' have been split out into their own command. - describe: with PTA stripped out, the cost is now bounded by type checking. Performance: - The importer.Config.TypeCheckFuncBodies predicate supports setting the 'IgnoreFuncBodies' typechecker flag on a per-package basis. This means we can load dependencies from source more quickly if we only need exported types. (We avoid gcimport data because it may be absent or stale.) This also means we can run type-based queries on packages that aren't part of the pointer analysis scope. (Yay.) - Modes that require only type analysis of the query package run a "what" query first, and restrict their analysis scope to just that package and its dependencies (sans func bodies), making them much faster. - We call newOracle not oracle.New in Query, so that the 'needs' bitset isn't ignored (oops!). This makes the non-PTA queries faster. Also: - removed vestigial timers junk. - pos.go: existing position utilties split out into own file. Added parsePosFlag utility. - numerous cosmetic tweaks. + very basic tests. To do in follow-ups: - sophisticated editor integration of "what". - better tests. - refactoring of control flow as described in comment. - changes to "implements", "describe" commands. - update design doc + user manual.

Patch Set 1 #

Patch Set 2 : diff -r 563f7f5657bb https://code.google.com/p/go.tools #

Patch Set 3 : diff -r 563f7f5657bb https://code.google.com/p/go.tools #

Patch Set 4 : diff -r 000d539042f7 https://code.google.com/p/go.tools #

Patch Set 5 : diff -r 000d539042f7 https://code.google.com/p/go.tools #

Patch Set 6 : diff -r 000d539042f7 https://code.google.com/p/go.tools #

Patch Set 7 : diff -r 000d539042f7 https://code.google.com/p/go.tools #

Patch Set 8 : diff -r 000d539042f7 https://code.google.com/p/go.tools #

Total comments: 12

Patch Set 9 : diff -r 6a99792186b8 https://code.google.com/p/go.tools #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1518 lines, -647 lines) Patch
M astutil/enclosing.go View 1 1 chunk +1 line, -1 line 0 comments Download
M cmd/oracle/main.go View 1 1 chunk +1 line, -1 line 0 comments Download
M cmd/oracle/oracle.el View 1 2 3 4 5 6 7 3 chunks +18 lines, -4 lines 0 comments Download
M importer/importer.go View 1 2 3 4 5 6 7 8 5 chunks +36 lines, -10 lines 0 comments Download
M importer/pkginfo.go View 1 2 3 2 chunks +14 lines, -2 lines 0 comments Download
A oracle/TODO View 1 2 3 4 5 6 7 1 chunk +99 lines, -0 lines 0 comments Download
M oracle/callees.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M oracle/callers.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M oracle/callgraph.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M oracle/callstack.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
A oracle/definition.go View 1 2 3 1 chunk +53 lines, -0 lines 0 comments Download
M oracle/describe.go View 1 2 3 14 chunks +21 lines, -253 lines 0 comments Download
M oracle/freevars.go View 1 2 3 5 chunks +16 lines, -4 lines 0 comments Download
M oracle/implements.go View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M oracle/oracle.go View 1 2 3 4 17 chunks +172 lines, -182 lines 0 comments Download
M oracle/oracle_test.go View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M oracle/peers.go View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
A oracle/pointsto.go View 1 2 3 4 5 6 7 8 1 chunk +257 lines, -0 lines 0 comments Download
A oracle/pos.go View 1 2 3 1 chunk +149 lines, -0 lines 0 comments Download
M oracle/referrers.go View 1 2 3 3 chunks +19 lines, -9 lines 0 comments Download
M oracle/serial/serial.go View 1 2 3 4 5 6 7 8 5 chunks +44 lines, -21 lines 0 comments Download
M oracle/testdata/src/main/calls.go View 1 4 chunks +6 lines, -6 lines 0 comments Download
M oracle/testdata/src/main/calls.golden View 1 4 chunks +10 lines, -17 lines 0 comments Download
M oracle/testdata/src/main/describe.go View 1 1 chunk +4 lines, -6 lines 0 comments Download
M oracle/testdata/src/main/describe.golden View 1 4 chunks +18 lines, -42 lines 0 comments Download
M oracle/testdata/src/main/describe-json.golden View 1 2 chunks +2 lines, -29 lines 0 comments Download
M oracle/testdata/src/main/freevars.golden View 1 2 1 chunk +1 line, -1 line 0 comments Download
M oracle/testdata/src/main/imports.go View 1 1 chunk +1 line, -1 line 0 comments Download
M oracle/testdata/src/main/imports.golden View 1 3 chunks +4 lines, -6 lines 0 comments Download
M oracle/testdata/src/main/peers.go View 1 1 chunk +5 lines, -5 lines 0 comments Download
M oracle/testdata/src/main/peers.golden View 1 3 chunks +10 lines, -20 lines 0 comments Download
A oracle/testdata/src/main/pointsto.go View 1 1 chunk +68 lines, -0 lines 0 comments Download
A oracle/testdata/src/main/pointsto.golden View 1 1 chunk +93 lines, -0 lines 0 comments Download
A oracle/testdata/src/main/pointsto-json.go View 1 1 chunk +27 lines, -0 lines 0 comments Download
A oracle/testdata/src/main/pointsto-json.golden View 1 1 chunk +34 lines, -0 lines 0 comments Download
M oracle/testdata/src/main/reflection.go View 1 2 chunks +7 lines, -7 lines 0 comments Download
M oracle/testdata/src/main/reflection.golden View 1 3 chunks +6 lines, -12 lines 0 comments Download
A oracle/testdata/src/main/what.go View 1 2 3 4 5 6 7 1 chunk +11 lines, -0 lines 0 comments Download
A oracle/testdata/src/main/what.golden View 1 2 3 4 5 6 7 1 chunk +39 lines, -0 lines 0 comments Download
A oracle/testdata/src/main/what-json.go View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
A oracle/testdata/src/main/what-json.golden View 1 2 3 4 5 6 1 chunk +52 lines, -0 lines 0 comments Download
A oracle/what.go View 1 2 3 4 5 6 7 8 1 chunk +197 lines, -0 lines 0 comments Download
M pointer/labels.go View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 6
adonovan
Hello crawshaw@google.com (cc: golang-dev@googlegroups.com, gri@golang.org), I'd like you to review this change to https://code.google.com/p/go.tools
10 years, 5 months ago (2013-12-12 19:38:15 UTC) #1
Dominik Honnef
https://codereview.appspot.com/40630043/diff/130001/cmd/oracle/oracle.el File cmd/oracle/oracle.el (right): https://codereview.appspot.com/40630043/diff/130001/cmd/oracle/oracle.el#newcode40 cmd/oracle/oracle.el:40: ;; makes it harder to use the oracle. I ...
10 years, 5 months ago (2013-12-13 08:40:05 UTC) #2
crawshaw1
LGTM https://codereview.appspot.com/40630043/diff/130001/importer/importer.go File importer/importer.go (right): https://codereview.appspot.com/40630043/diff/130001/importer/importer.go#newcode85 importer/importer.go:85: // The supplied IgnoreFuncBodies is ignored; the effective ...
10 years, 5 months ago (2013-12-13 13:44:36 UTC) #3
adonovan
https://codereview.appspot.com/40630043/diff/130001/cmd/oracle/oracle.el File cmd/oracle/oracle.el (right): https://codereview.appspot.com/40630043/diff/130001/cmd/oracle/oracle.el#newcode40 cmd/oracle/oracle.el:40: ;; makes it harder to use the oracle. On ...
10 years, 5 months ago (2013-12-13 15:00:36 UTC) #4
adonovan
*** Submitted as https://code.google.com/p/go/source/detail?r=4e56dc65c681&repo=tools *** go.tools/oracle: improvements to command set and performance. Command set: - ...
10 years, 5 months ago (2013-12-13 15:04:58 UTC) #5
adonovan
10 years, 5 months ago (2013-12-13 18:29:47 UTC) #6
Message was sent while issue was closed.
*** Abandoned ***
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b