From d2f663c4f241b2f1318f5126c206436afaefdadd Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 18 Jul 2018 15:45:56 -0400 Subject: [PATCH] doc/go1.11: mention major performance optimizations Change-Id: I25b93a84996ab1c17d64089b4c2ffabdff3365ec Reviewed-on: https://go-review.googlesource.com/124710 Reviewed-by: Austin Clements --- doc/go1.11.html | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/doc/go1.11.html b/doc/go1.11.html index f806fe0e03..c62165af4e 100644 --- a/doc/go1.11.html +++ b/doc/go1.11.html @@ -317,6 +317,42 @@ func f(v interface{}) { system calls; fixing this is planned for a future release.

+

Performance

+ +

+As always, the changes are so general and varied that precise +statements about performance are difficult to make. Most programs +should run a bit faster, due to better generated code and +optimizations in the core library. +

+ +

Compiler toolchain

+ +

+ The compiler now optimizes map clearing operations of the form: +

+
+for k := range m {
+	delete(m, k)
+}
+
+ +

+ The compiler now optimizes slice extension of the form + append(s, make([]T, n)...). +

+ +

+ The compiler now performs significantly more aggressive bounds-check + and branch elimination. Notably, it now recognizes transitive + relations, so if i<j and j<len(s), + it can use these facts to eliminate the bounds check + for s[i]. It also understands simple arithmetic such + as s[i-10] and can recognize more inductive cases in + loops. Furthermore, the compiler now uses bounds information to more + aggressively optimize shift operations. +

+

Core library