Skip to content

Commit d2f663c

Browse files
committed
doc/go1.11: mention major performance optimizations
Change-Id: I25b93a84996ab1c17d64089b4c2ffabdff3365ec Reviewed-on: https://go-review.googlesource.com/124710 Reviewed-by: Austin Clements <[email protected]>
1 parent d0764a2 commit d2f663c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

doc/go1.11.html

+36
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,42 @@ <h2 id="runtime">Runtime</h2>
317317
system calls; fixing this is planned for a future release.
318318
</p>
319319

320+
<h2 id="performance">Performance</h2>
321+
322+
<p>
323+
As always, the changes are so general and varied that precise
324+
statements about performance are difficult to make. Most programs
325+
should run a bit faster, due to better generated code and
326+
optimizations in the core library.
327+
</p>
328+
329+
<h3 id="performance-compiler">Compiler toolchain</h3>
330+
331+
<p><!-- CL 110055 -->
332+
The compiler now optimizes map clearing operations of the form:
333+
</p>
334+
<pre>
335+
for k := range m {
336+
delete(m, k)
337+
}
338+
</pre>
339+
340+
<p><!-- CL 109517 -->
341+
The compiler now optimizes slice extension of the form
342+
<code>append(s,</code>&nbsp;<code>make([]T,</code>&nbsp;<code>n)...)</code>.
343+
</p>
344+
345+
<p><!-- CL 100277, CL 105635, CL 109776 -->
346+
The compiler now performs significantly more aggressive bounds-check
347+
and branch elimination. Notably, it now recognizes transitive
348+
relations, so if <code>i&lt;j</code> and <code>j&lt;len(s)</code>,
349+
it can use these facts to eliminate the bounds check
350+
for <code>s[i]</code>. It also understands simple arithmetic such
351+
as <code>s[i-10]</code> and can recognize more inductive cases in
352+
loops. Furthermore, the compiler now uses bounds information to more
353+
aggressively optimize shift operations.
354+
</p>
355+
320356
<h2 id="library">Core library</h2>
321357

322358
<p>

0 commit comments

Comments
 (0)