mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
Updated CompilerOptimizations (markdown)
parent
9b72758a61
commit
25b2f97277
@ -27,6 +27,20 @@ For a map m of type map[string]T and []byte b, m[string(b)] doesn't allocate. (t
|
||||
* **gc:** 1.4+
|
||||
* **gccgo:** ?
|
||||
|
||||
### range over []byte(s)
|
||||
|
||||
Avoiding allocating []byte of a string when ranging over the bytes:
|
||||
|
||||
```
|
||||
s := "foo"
|
||||
for i, c := range []byte(s) {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
* **gc:** 1.5+ (CL 3790)
|
||||
* **gccgo:** ?
|
||||
|
||||
## Escape analysis and Inlining
|
||||
|
||||
Use `-gcflags -m` to observe the result of escape analysis and inlining
|
||||
|
Loading…
x
Reference in New Issue
Block a user