Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

5.
INFRASTRUCTURE
• Same conﬁg, same logging, same directory structure
• Same protocol, including JSON to Protobuf conversion
• Build and testing inTeamCity
• QA team should not know this is a Go project
Go is not special in any way

6.
INFRASTRUCTURE
• Logs go to syslog and eventually to Splunk
• Metrics are collected with home-grown system based on
RRD (you will see some examples)
• HTTP based proﬁling is always on

7.
INFRASTRUCTURE
• As of now we do not use vendoring
• We use go get for dependencies
• Sometimes we just fork projects (as with rocksdb lib)
• We use Make for building

37.
GO IS NOT C
• C is using pointers is C
• Go is different, learned it the hard way
• Often it is preferable to copy a little bit,
but avoid using pointers
• We had to thoroughly inspect our code
and remove pointers everywhere we
could

58.
type Person struct {
Name [6]byte // was string
Age uint
}
var People []Person // was []*Person
no pointers in struct
so GC treats this as a single object and does not “look inside”
= fast GC
So we expect the same for map[k]v when k/v contain no pointers
MAPS

60.
commit 85e7bee19f9f26dfca414b1e9054e429c448b14f
Author: Dmitry Vyukov <dvyukov@google.com>
Date: Mon Jan 26 21:04:41 2015 +0300
!
runtime: do not scan maps when k/v do not contain pointers
!
Currently we scan maps even if k/v does not contain pointers.
This is required because overflow buckets are hanging off the main table.
This change introduces a separate array that contains pointers to all
overflow buckets and keeps them alive. Buckets themselves are marked
as containing no pointers and are not scanned by GC (if k/v does not
contain pointers).
!
This brings maps in line with slices and chans -- GC does not scan
their contents if elements do not contain pointers.
!
Currently scanning of a map[int]int with 2e8 entries (~8GB heap)
takes ~8 seconds. With this change scanning takes negligible time.
!
Update #9477.
!
Change-Id: Id8a04066a53d2f743474cad406afb9f30f00eaae
Reviewed-on: https://go-review.googlesource.com/3288
Reviewed-by: Keith Randall <khr@golang.org>
expected in 1.5
https://github.com/golang/go/issues/9477