Commit Graph

1777 Commits

Author SHA1 Message Date
Chris Masone f533bd08f8 Add back pprof.StopCPUProfile() in profile.go 2016-06-13 15:45:31 -07:00
Mike Gray 166a83979b limit the size of the edit distance matrix (#1739) 2016-06-13 17:18:35 -04:00
Chris Masone 1689981c84 Go: Fix race condition in httpBatchStore
In httpBatchStore.Get() and Has(), I add 1 to a WaitGroup, so that
Flush() and Close() can wait for all outstanding requests to complete.

As each Get or Has is processed, it's added to a ReadBatch. Once the
batch is processed, the WaitGroup count is decreased by the size of
the ReadBatch...  but ReadBatch is a map! So if the same object is
passed to Get or Has twice, it will (by design) only show up in the
ReadBatch once. That means that we'd add 2 to the WaitGroup, but only
remove 1!

This will lead to waiting forever on Flush() or Close(), and is no
good.
2016-06-13 13:19:38 -07:00
Rafael Weinstein ba909929c2 Revert "tweak ldb settings for put cache (#1806)"
This reverts commit 527a9bd6d6.
2016-06-13 13:13:43 -07:00
Rafael Weinstein 527a9bd6d6 tweak ldb settings for put cache (#1806)
tweak ldb settings for put cache
2016-06-13 11:18:40 -07:00
Aaron Boodman fcf772dccd move noms/samples/go/flags -> noms/go/spec (#1799) 2016-06-12 15:42:50 -07:00
Mike Gray 48b23c0bf0 adding t.Parallel() to some of the longer tests to allow them to run in parallel (#1774) 2016-06-10 13:52:48 -04:00
cmasone-attic b12bc0b89d Merge pull request #1777 from cmasone-attic/newprof
Go: Simplify enabling profiling
2016-06-10 09:45:16 -07:00
Chris Masone e35a705da5 Go: Simplify enabling profiling
One side effect of the way that Go's flag library works is that any
flag that's defined at the global scope by any library that's built
into your binary shows up in your help -- whether you honor it or
not. Arguably, including the library and calling its entry points
should be tantamount to honoring the flags. This change makes the
profiling flags behave that way -- there's one function that you call
to turn on whichever kinds of profiling the user specifies on the
command line. It returns an object with a Stop() method that you call
to shut down profiling and flush data, like so:

defer profile.MaybeStartProfile().Stop()
2016-06-10 09:01:13 -07:00
Chris Masone 58b44fae52 Small tweaks to speed HandleWriteValue a bit
The bigger change here is having chunks.DeserializeToChan take a
channel of *Chunk, instead of Chunk. It saves a couple of seconds
when committing the sfcrime dataset.

Also, get rid of a d.Chk.Equal in favor of a d.Chk.True and increase
the batch size that ValidatingBatchSink uses to reduce stalls due to
putting into a ChunkStore.
2016-06-10 08:38:53 -07:00
Mike Gray f94b91a5d2 sequences return a compare func used for diffs (#1771) 2016-06-09 23:17:14 -04:00
Chris Masone 31e25ffc81 Go: Allow serialization of a single Chunk without a Chunk serializer
In datas/put_cache.go, we need to serialize one chunk at a time. With
the old API, this entailed creating a serializer (which creates some
channels and a goroutine) only to use it for one Chunk.

Instead, just expose Serialize() and use it directly.
2016-06-09 12:54:27 -07:00
Rafael Weinstein d4941f6b1e Hash compare uses bytes.Compare (#1765) 2016-06-08 17:25:52 -07:00
Chris Masone 42cb294b57 Go: writeValue/ payload uses snappy instead of gzip
We determined that gzipping the entire writeValue payload at Commit-
time was extremely time-expensive. After doing some experiments, it
seems that a couple of changes make Commit go a lot faster:

1) Use snappy instead of gzip
2) Compress chunks individually instead of delaying until the whole
   stream is ready.

This does result in more data needing to be sent over the network.
However, we get to the point of being able to send data _much_ sooner.

Since Chunks are compressed individually, the orderedChunkCache code
now compresses them before storing them, also saving disk space.
2016-06-08 15:46:08 -07:00
cmasone-attic 39bc733a63 Go: Stop treating a chunk's hash as a hint for itself (#1758)
At some point, the Go ValueStore code started caching the hash of a
Chunk as a validation 'hint' for the Chunk itself.  JS never did
this. This must have addressed some edge case back when it was fatal
for validation code to run across a Chunk it hadn't seen and didn't
have a hint for. The downside is that doing this can cause us to send
a hint for every novel Chunk present in a writeValue payload in the
worst case.

Since I can't remember the edge case, and that edge case will no
longer be fatal anyway, removing this to avoid the (potentially
terrible) downside makes sense.
2016-06-08 15:36:16 -07:00
Rafael Weinstein 10482e26e4 Remove postRefs end point (#1761) 2016-06-08 15:23:05 -07:00
Erik Arvidsson 5571e0bc6f Add commas to HRS of struct type (#1759)
This makes the struct more consistent with the rest.
2016-06-08 14:54:47 -07:00
Mike Gray 4303450a7e fixing bug #1723, diff being slow (#1748)
fixing bug #1723, diff was slow due to an incorrect comparison of metaTuple values
2016-06-08 14:44:09 -07:00
Erik Arvidsson d13dc6a2c5 HRS: No need to tag numbers any more (#1760) 2016-06-08 14:42:37 -07:00
cmasone-attic 00af81440f Move Go profiling helpers out of samples/ (#1757)
These are used in cmd as well, so it seemed weird to have
them over in samples/util
2016-06-08 14:26:44 -07:00
Erik Arvidsson bc896efcc5 Add tests for type after mutations (#1753)
Also, remove invariant for set intersection. We can handle different
types now.

Fixes #1749
2016-06-08 11:39:12 -07:00
cmasone-attic 74a0c98d75 Go: Use unified ref-height-based Pull algorithm (#1722)
Change Dataset.Pull to use a single algorithm to pull data from a
source to a sink, regardless of which (if any) is local. The basic
algorithm is described in the first section of pulling.md. This
implementation is equivalent but phrased a bit differently. The
algorithm actually used is described in the second section of
pulling.md

The main changes:
- datas.Pull(), which implements the new pulling algorithm
- RefHeap, a priority queue that sorts types.Ref by ref-height and
  then by ref.TargetHash()
- Add has() to both Database implementations. Cache has() checks.
- Switch Dataset to use new datas.Pull(). Currently not concurrent.

Toward #1568


Mostly, prune reachableChunks
2016-06-08 08:57:48 -07:00
Erik Arvidsson abbd0cfb1e JS: Make Structs use arrays (#1743)
...instead of objects as maps.

Fixes #1715
2016-06-07 15:59:27 -07:00
Erik Arvidsson bc9f9d19e1 Go: Make StructDesc use slices for names and types instead of a map (#1741)
The map showed up in benchmarks...

Fixes #1716
2016-06-06 16:58:40 -07:00
Mike Gray 9763c25d93 reduce memory usage in index sequence diff (#1736) 2016-06-06 15:41:25 -04:00
Aaron Boodman ef4bf7811c Move nomdl to go/ 2016-06-05 02:23:09 -07:00
Aaron Boodman bb7ac52265 Move the Go SDK into noms/go 2016-06-05 02:14:49 -07:00