OLD | NEW |
1 <!--{ | 1 <!--{ |
2 "Title": "Go 1.4 Release Notes", | 2 "Title": "Go 1.4 Release Notes", |
3 "Path": "/doc/go1.4", | 3 "Path": "/doc/go1.4", |
4 "Template": true | 4 "Template": true |
5 }--> | 5 }--> |
6 | 6 |
7 <h2 id="introduction">Introduction to Go 1.4</h2> | 7 <h2 id="introduction">Introduction to Go 1.4</h2> |
8 | 8 |
9 <p> | 9 <p> |
10 The latest Go release, version 1.4, arrives as scheduled six months after 1.3 | 10 The latest Go release, version 1.4, arrives as scheduled six months after 1.3 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 </p> | 80 </p> |
81 | 81 |
82 <h2 id="os">Changes to the supported operating systems and architectures</h2> | 82 <h2 id="os">Changes to the supported operating systems and architectures</h2> |
83 | 83 |
84 <h3 id="foobarblatz">FooBarBlatz</h3> | 84 <h3 id="foobarblatz">FooBarBlatz</h3> |
85 | 85 |
86 <p> | 86 <p> |
87 TODO news about foobarblatz | 87 TODO news about foobarblatz |
88 </p> | 88 </p> |
89 | 89 |
| 90 <h2 id="runtime">Changes to the runtime</h2> |
| 91 |
| 92 <p> |
| 93 Up to Go 1.4, the runtime (garbage collector, concurrency support, interface man
agement, |
| 94 maps, slices, strings, ...) was mostly written in C, with some assembler support
. |
| 95 In 1.4, much of the code has been translated to Go so that the garbage collector
can scan |
| 96 the stacks of programs in the runtime and get accurate information about what va
riables |
| 97 are active. |
| 98 This change was large but should have no semantic effect on programs. |
| 99 </p> |
| 100 |
| 101 <p> |
| 102 This rewrite allows the garbage collector in 1.4 to be fully precise, |
| 103 meaning that it is aware of the location of all active pointers in the program. |
| 104 This means the heap will be smaller as there will be no false positives keeping
non-pointers alive. |
| 105 Other related changes also reduce the heap size, which is smaller by 10%-30% ove
rall |
| 106 relative to the previous release. |
| 107 </p> |
| 108 |
| 109 <p> |
| 110 A consequence is that stacks are no longer segmented, eliminating the "hot split
" problem. |
| 111 When a stack limit is reached, a new, larger stack is allocated, all active fram
es for |
| 112 the goroutine are copied there, and any pointers into that stack can be updated. |
| 113 Performance can be noticeably better in some cases and always more predictable. |
| 114 Details are available in <a href="/s/contigstacks">the design document</a>. |
| 115 </p> |
| 116 |
| 117 <p> |
| 118 The use of contiguous stacks mean that stacks can start smaller without triggeri
ng performance issues, |
| 119 so the default starting size for a goroutine's stack in 1.4 has been reduced to
2048 bytes from 8192 bytes. |
| 120 TODO: It may be bumped to 4096 for the release. |
| 121 </p> |
| 122 |
| 123 <p> |
| 124 As preparation for the concurrent garbage collector scheduled for the 1.5 releas
e, |
| 125 writes to pointer values in the heap are now done by a function call, |
| 126 called a write barrier, rather than directly from the function updating the valu
e. |
| 127 In this next release, this will permit the garbage collector to mediate writes t
o the heap while it is running. |
| 128 This change has no semantic effect on programs in 1.4, but was |
| 129 included in the release to test the compiler and the resulting performance. |
| 130 </p> |
| 131 |
| 132 <p> |
| 133 The implementation of interface values has been modified. |
| 134 In earlier releases, the interface contained a word that was either a pointer or
a one-word |
| 135 scalar value, depending on the type of the concrete object stored. |
| 136 This implementation was problematical for the garbage collector, |
| 137 so as of 1.4 interface values always hold a pointer. |
| 138 In running programs, most interface values were pointers anyway, |
| 139 so the effect is minimal, but programs store integers (for example) in |
| 140 interfaces will see more allocations. |
| 141 </p> |
| 142 |
90 <h2 id="compatibility">Changes to the compatibility guidelines</h2> | 143 <h2 id="compatibility">Changes to the compatibility guidelines</h2> |
91 | 144 |
92 <p> | 145 <p> |
93 The <a href="/pkg/unsafe/"><code>unsafe</code></a> package allows one | 146 The <a href="/pkg/unsafe/"><code>unsafe</code></a> package allows one |
94 to defeat Go's type system by exploiting internal details of the implementation | 147 to defeat Go's type system by exploiting internal details of the implementation |
95 or machine representation of data. | 148 or machine representation of data. |
96 It was never explicitly specified what use of <code>unsafe</code> meant | 149 It was never explicitly specified what use of <code>unsafe</code> meant |
97 with respect to compatibility as specified in the | 150 with respect to compatibility as specified in the |
98 <a href="go1compat.html">Go compatibilty guidelines</a>. | 151 <a href="go1compat.html">Go compatibilty guidelines</a>. |
99 The answer, of course, is that we can make no promise of compatibility | 152 The answer, of course, is that we can make no promise of compatibility |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 223 |
171 <h3 id="misc">Miscellany</h3> | 224 <h3 id="misc">Miscellany</h3> |
172 | 225 |
173 <p> | 226 <p> |
174 TODO misc news | 227 TODO misc news |
175 </p> | 228 </p> |
176 | 229 |
177 <h2 id="performance">Performance</h2> | 230 <h2 id="performance">Performance</h2> |
178 | 231 |
179 <p> | 232 <p> |
180 TODO performance news | 233 Most programs will run about the same speed or slightly faster in 1.4 than in 1.
3; |
| 234 some will be slightly slower. |
| 235 There are many changes, making it hard to be precise about what to expect. |
| 236 </p> |
| 237 |
| 238 <p> |
| 239 As mentioned above, much of the runtime was translated to Go from C, |
| 240 which led to some reduction in heap sizes. |
| 241 It also improved performance slightly because the Go compiler is better |
| 242 at optimization, due to things like inlining, than the C compiler used to build |
| 243 the runtime. |
| 244 </p> |
| 245 |
| 246 <p> |
| 247 The garbage collector was sped up, leading to measurable improvements for |
| 248 garbage-heavy programs. |
| 249 On the other hand, the new write barriers slow things down again, typically |
| 250 by about the same amount but, depending on their behavior, some programs |
| 251 may be somewhat slower or faster. |
| 252 </p> |
| 253 |
| 254 <p> |
| 255 Library changes that affect performance are documented below. |
181 </p> | 256 </p> |
182 | 257 |
183 <h2 id="library">Changes to the standard library</h2> | 258 <h2 id="library">Changes to the standard library</h2> |
184 | 259 |
185 <h3 id="new_packages">New packages</h3> | 260 <h3 id="new_packages">New packages</h3> |
186 | 261 |
187 <p> | 262 <p> |
188 TODO new packages | 263 TODO new packages |
189 </p> | 264 </p> |
190 | 265 |
(...skipping 11 matching lines...) Expand all Loading... |
202 </p> | 277 </p> |
203 | 278 |
204 <ul> | 279 <ul> |
205 | 280 |
206 <li> TODO changes | 281 <li> TODO changes |
207 </li> | 282 </li> |
208 </ul> | 283 </ul> |
209 | 284 |
210 <pre> | 285 <pre> |
211 | 286 |
212 the directory src/pkg has been deleted, for instance src/pkg/fmt is now just src
/fmt (CL 134570043) | |
213 | |
214 cmd/6l, liblink: use pc-relative addressing for all memory references, so that l
inking Go binaries at high addresses works (CL 125140043). This cuts the maximum
size of a Go binary's text+data+bss from 4GB to 2GB. | 287 cmd/6l, liblink: use pc-relative addressing for all memory references, so that l
inking Go binaries at high addresses works (CL 125140043). This cuts the maximum
size of a Go binary's text+data+bss from 4GB to 2GB. |
215 cmd/go: import comments (CL 124940043) | 288 cmd/go: import comments (CL 124940043) |
216 cmd/go: implement "internal" (CL 120600043) | 289 cmd/go: implement "internal" (CL 120600043) |
217 cmd/go: implement "generate" (CL 125580044) | 290 cmd/go: implement "generate" (CL 125580044) |
218 cmd/go: disallow C sources except when using cgo (CL 149720043) | 291 cmd/go: disallow C sources except when using cgo (CL 149720043) |
219 cmd/go: add test -o flag (CL 149070043) | 292 cmd/go: add test -o flag (CL 149070043) |
220 cmd/go: redefine build -a to skip standard library in releases (CL 151730045) | 293 cmd/go: redefine build -a to skip standard library in releases (CL 151730045) |
221 cmd/go: compile and link all _test.go files during 'go test', even in packages w
here there are no Test functions (CL 150980043) | 294 cmd/go: compile and link all _test.go files during 'go test', even in packages w
here there are no Test functions (CL 150980043) |
222 cmd/go: (via go/build): a GOOS prefix acts as a tag only if preceded by an under
score. this is a breaking change. (CL 147690043) | 295 cmd/go: (via go/build): a GOOS prefix acts as a tag only if preceded by an under
score. this is a breaking change. (CL 147690043) |
223 | 296 |
224 asm: make textflag.h available outside of cmd/ld (CL 128050043) | 297 asm: make textflag.h available outside of cmd/ld (CL 128050043) |
225 bufio: handling of empty tokens at EOF changed, may require scanner change (CL 1
45390043) | 298 bufio: handling of empty tokens at EOF changed, may require scanner change (CL 1
45390043) |
226 compress/flate, compress/gzip, compress/zlib: Reset support (https://codereview.
appspot.com/97140043) | 299 compress/flate, compress/gzip, compress/zlib: Reset support (https://codereview.
appspot.com/97140043) |
227 crypto/tls: add support for ALPN (RFC 7301) (CL 108710046) | 300 crypto/tls: add support for ALPN (RFC 7301) (CL 108710046) |
228 crypto/tls: support programmatic selection of server certificates (CL 107400043) | 301 crypto/tls: support programmatic selection of server certificates (CL 107400043) |
229 encoding/asn1: optional elements with a default value will now only be omitted i
f they have that value (CL 86960045) | 302 encoding/asn1: optional elements with a default value will now only be omitted i
f they have that value (CL 86960045) |
230 flag: it is now an error to set a flag multiple times (CL 156390043) | 303 flag: it is now an error to set a flag multiple times (CL 156390043) |
231 fmt: print type *map[T]T as &map[k:v] (CL 154870043) | 304 fmt: print type *map[T]T as &map[k:v] (CL 154870043) |
232 encoding/csv: do not quote empty strings, quote \. (CL 164760043) | 305 encoding/csv: do not quote empty strings, quote \. (CL 164760043) |
233 encoding/gob: remove unsafe (CL 102680045) | 306 encoding/gob: remove unsafe (CL 102680045) |
234 misc: deleted editor support; refer to https://code.google.com/p/go-wiki/wiki/ID
EsAndTextEditorPlugins instead (CL 105470043) | 307 misc: deleted editor support; refer to https://code.google.com/p/go-wiki/wiki/ID
EsAndTextEditorPlugins instead (CL 105470043) |
235 net/http: add Request.BasicAuth method (CL 76540043) | 308 net/http: add Request.BasicAuth method (CL 76540043) |
236 net/http: add Transport.DialTLS hook (CL 137940043) | 309 net/http: add Transport.DialTLS hook (CL 137940043) |
237 net/http/httputil: add ReverseProxy.ErrorLog (CL 132750043) | 310 net/http/httputil: add ReverseProxy.ErrorLog (CL 132750043) |
238 os: implement symlink support for windows (CL 86160044) | 311 os: implement symlink support for windows (CL 86160044) |
239 reflect: add type.Comparable (CL 144020043) | 312 reflect: add type.Comparable (CL 144020043) |
| 313 reflect: Value is one word smaller |
240 runtime: implement monotonic clocks on windows (CL 108700045) | 314 runtime: implement monotonic clocks on windows (CL 108700045) |
241 runtime: memory consumption is reduced by 10-30% (CL 106260045 removes type info
from heap, CL 145790043 reduces stack size to 2K (4K on plan 9 and windows)) | |
242 runtime: MemStats.Mallocs now counts very small allocations missed in Go 1.3. Th
is may break tests using runtime.ReadMemStats or testing.AllocsPerRun by giving
a more accurate answer than Go 1.3 did (CL 143150043). | 315 runtime: MemStats.Mallocs now counts very small allocations missed in Go 1.3. Th
is may break tests using runtime.ReadMemStats or testing.AllocsPerRun by giving
a more accurate answer than Go 1.3 did (CL 143150043). |
243 runtime/race: freebsd is supported (CL 107270043) | 316 runtime/race: freebsd is supported (CL 107270043) |
244 swig: Due to runtime changes Go 1.4 will require SWIG 3.0.3 (not yet released) | 317 swig: Due to runtime changes Go 1.4 will require SWIG 3.0.3 (not yet released) |
245 sync/atomic: add Value (CL 136710045) | 318 sync/atomic: add Value (CL 136710045) |
246 syscall: Setuid, Setgid are disabled on linux platforms. On linux those syscalls
operate on the calling thread, not the whole process. This does not match the s
emantics of other platforms, nor the expectations of the caller, so the operatio
ns have been disabled until issue 1435 is resolved (CL 106170043) | 319 syscall: Setuid, Setgid are disabled on linux platforms. On linux those syscalls
operate on the calling thread, not the whole process. This does not match the s
emantics of other platforms, nor the expectations of the caller, so the operatio
ns have been disabled until issue 1435 is resolved (CL 106170043) |
247 syscall: now frozen (CL 129820043) | 320 syscall: now frozen (CL 129820043) |
248 testing: add Coverage (CL 98150043) | 321 testing: add Coverage (CL 98150043) |
249 testing: add TestMain support (CL 148770043) | 322 testing: add TestMain support (CL 148770043) |
250 text/scanner: add IsIdentRune field of Scanner. (CL 108030044) | 323 text/scanner: add IsIdentRune field of Scanner. (CL 108030044) |
251 text/template: allow comparison of signed and unsigned integers (CL 149780043) | 324 text/template: allow comparison of signed and unsigned integers (CL 149780043) |
252 time: use the micro symbol (µ (U+00B5)) to print microsecond duration (CL 105030
046) | 325 time: use the micro symbol (µ (U+00B5)) to print microsecond duration (CL 105030
046) |
253 unsafe: document the existing situation that unsafe programs are not go1-guarant
eed (CL 162060043) | 326 unsafe: document the existing situation that unsafe programs are not go1-guarant
eed (CL 162060043) |
254 | 327 |
255 go.sys subrepo created: http://golang.org/s/go1.4-syscall | 328 go.sys subrepo created: http://golang.org/s/go1.4-syscall |
256 </pre> | 329 </pre> |
OLD | NEW |