1
0
mirror of https://github.com/golang/go synced 2024-10-01 09:38:36 -06:00
go/oracle
Alan Donovan e2921e188a go.tools/importer: make loading/parsing concurrent.
1. ParseFiles (in util.go) parses each file in its own goroutine.

2. (*Importer).LoadPackage asynchronously prefetches the
   import graph by scanning the imports of each loaded package
   and calling LoadPackage on each one.

   LoadPackage is now thread-safe and idempotent: it uses a
   condition variable per package; the first goroutine to
   request a package becomes responsible for loading it and
   broadcasts to the others (waiting) when it becomes ready.

ssadump runs 34% faster when loading the oracle.

Also, refactorings:
- delete SourceLoader mechanism; just expose go/build.Context directly.
- CreateSourcePackage now also returns an error directly,
  rather than via PackageInfo.Err, since every client wants that.

R=crawshaw
CC=golang-dev
https://golang.org/cl/13509045
2013-09-04 13:15:49 -04:00
..
json go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
testdata/src go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
callees.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
callers.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
callgraph.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
callstack.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
describe.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
freevars.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
implements.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
oracle_test.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00
oracle.go go.tools/importer: make loading/parsing concurrent. 2013-09-04 13:15:49 -04:00
peers.go go.tools/oracle: add option to output results in JSON syntax. 2013-09-03 15:29:02 -04:00