-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgo1.8.slide
84 lines (50 loc) · 1.69 KB
/
go1.8.slide
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Go 1.8 Features
16 Feb 2016
Dinesh Kumar
https://github.com/devdinu
Rajeev BharShetty
https://github.com/rShetty
* GOPATH
- $HOME/go Unix,MAC
- %USERPROFILE%\go Windows
go env GOPATH
* GC Pause
*** Gopher
.code src/trace1.part
* GC Pause
*** 2 GoRoutines
.code src/trace2.part
* STW why?
- Tricolor GC (Black, Grey, White)
- Write Barriers
- STW (To Ensure that No White Nodes is referred)
- Free nodes which are White
.link https://blog.pusher.com/golangs-real-time-gc-in-theory-and-practice/ Tricolor Gc
* Verify
- Trace Tool
go install
GODEBUG=gctrace=1 GOGC=10 $GOBIN/trace
go tool trace -http=':1234' dumps/go1.8.trace
* HTTP ShutDown
- Listen on Signal (Interrupt) to gracefully shutdown server
server.Shutdown(context.Background())
.code src/graceful/graceful_shutdown.go /START OMIT/,/END OMIT/
* Slice Sort
.code src/slicesort/sort_gophers.go
* Encoding/base64
- Encoding.Strict returns error when trailing padding are not zero
data, err := base64.StdEncoding.Strict().DecodeString("WvLTlMrX9NpYDQlEIFlnDB==")
* Digging deeper to Encoding/base64
- Guess
"WvLTlMrX9NpYDQlEIFlnDB==" same as "WvLTlMrX9NpYDQlEIFlnDA==" ???
.play -edit ./src/encoding/encoding.go /START OMIT/,/END OMIT/
* References
.link https://beta.golang.org/doc/go1.8 go1.8 doc
.link https://tools.ietf.org/html/rfc4648#section-3.5 rfc46468 Canonical Encoding
.link https://github.com/golang/go/issues/16721#issuecomment-241085266 Making Sort Easier
.link https://blog.golang.org/go15gc go15gc
.link https://github.com/golang/proposal/blob/master/design/17503-eliminate-rescan.md Eliminate Rescan Proposal
* Questions
.image images/gopher_party1.8.png _ 500
* License
.image ./images/by-sa.png