закешированный к нам в целях безопасности дебаггер
Go to file
aarzilli 89c8da65b6 proc: Improve performance of loadMap on very large sparse maps
Users can create sparse maps in two ways, either by:
a) adding lots of entries to a map and then deleting most of them, or
b) using the make(mapType, N) expression with a very large N

When this happens reading the resulting map will be very slow
because loadMap needs to scan many buckets for each entry it finds.

Technically this is not a bug, the user just created a map that's
very sparse and therefore very slow to read. However it's very
annoying to have the debugger hang for several seconds when trying
to read the local variables just because one of them (which you
might not even be interested into) happens to be a very sparse map.

There is an easy mitigation to this problem: not reading any
additional buckets once we know that we have already read all
entries of the map, or as many entries as we need to fulfill the
MaxArrayValues parameter.

Unfortunately this is mostly useless, a VLSM (Very Large Sparse Map)
with a single entry will still be slow to access, because the single
entry in the map could easily end up in the last bucket.

The obvious solution to this problem is to set a limit to the
number of buckets we read when loading a map. However there is no
good way to set this limit.
If we hardcode it there will be no way to print maps that are beyond
whatever limit we pick.
We could let users (or clients) specify it but the meaning of such
knob would be arcane and they would have no way of picking a good
value (because there is no objectively good value for it).

The solution used in this commit is to set an arbirtray limit on
the number of buckets we read but only when loadMap is invoked
through API calls ListLocalVars and ListFunctionArgs. In this way
`ListLocalVars` and `ListFunctionArgs` (which are often invoked
automatically by GUI clients) remain fast even in presence of a
VLSM, but the contents of the VLSM can still be inspected using
`EvalVariable`.
2018-11-09 08:12:45 -08:00
_fixtures tests: rename _fixtures/vendor to _fixtures/internal 2018-11-06 08:52:06 -08:00
assets Add high-res images 2015-05-19 12:25:26 -05:00
cmd/dlv pkg/prog: Improve support for external debug info 2018-11-08 10:16:42 -08:00
Documentation Documentation,Makefile: better error when gencert.sh fails 2018-10-18 09:47:29 -07:00
pkg proc: Improve performance of loadMap on very large sparse maps 2018-11-09 08:12:45 -08:00
scripts Documentation,Makefile: better error when gencert.sh fails 2018-10-18 09:47:29 -07:00
service proc: Improve performance of loadMap on very large sparse maps 2018-11-09 08:12:45 -08:00
vendor *: Update vendor 2018-06-22 09:45:10 +02:00
.gitattributes makefile: use git's $Id$ instead of setting ver.Build in makefile (#807) 2017-04-28 10:14:33 -07:00
.gitignore git: Update gitignore 2015-10-20 20:55:11 -07:00
.travis.yml Add function call support for OSX 2018-08-30 15:48:10 -07:00
appveyor.yml *: Update appveyor.yml 2017-05-27 14:12:31 +02:00
CHANGELOG.md all: Bump to v1.1.0 2018-08-16 13:20:21 -07:00
CONTRIBUTING.md Update CONTRIBUTING.md 2016-05-13 10:43:09 +08:00
glide.lock *: Update vendor 2018-06-22 09:45:10 +02:00
glide.yaml *: Update vendor 2018-06-22 09:45:10 +02:00
go.mod *: Switch to using Go modules 2018-11-07 08:44:06 +01:00
go.sum *: Switch to using Go modules 2018-11-07 08:44:06 +01:00
ISSUE_TEMPLATE.md misc: Include issue template for GitHub 2016-03-03 10:40:14 -08:00
LICENSE Add License and README 2014-05-03 15:31:52 -05:00
Makefile Makefile: replace makefile with a script 2018-09-18 12:06:25 -07:00
README.md Fix SVG badges 2018-09-18 10:22:20 -07:00

Delve

license GoDoc Build Status Build status Join the chat at https://gitter.im/derekparker/delve

The Github issue tracker is for bugs only. Please use the developer mailing list for any feature proposals and discussions.

About Delve

Delve is a debugger for the Go programming language. The goal of the project is to provide a simple, full featured debugging tool for Go. Delve should be easy to invoke and easy to use. Chances are if you're using a debugger, things aren't going your way. With that in mind, Delve should stay out of your way as much as possible.