小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

Go 1.5新特性:支持Android,實驗性支持iOS(演講幻燈)

 quasiceo 2015-07-14

Go 1.5新特性:支持Android,實驗性支持iOS(演講幻燈)

The State of Go

Where we are in May 2015

27 May 2015

Andrew Gerrand

Go 1.5

Release schedule

Go 1.5 is scheduled for release in August 2015.

The major work is done.We are now in the "feature freeze" period.

From C to Go

The gc tool chain has been converted from C to Go.

Machine-translated compile tool replaces 6g , 8g , etc.

Machine-translated link tool replaces 6l , 8l , etc.

New asm tool replaces 6a , 8a , etc.

Go 1.5 has no C code in the tool chain or runtime.

Rob will talk more about this.

Concurrent Garbage Collector

Goals:

  • Limit GC latency to less than 10 milliseconds.
  • Run Go application code for at least 40ms out of every 50ms.

/s/go14gc

Concurrent GC trade-offs

The new GC spends a little more memory and CPU timein exchange for significantly shorter GC pause times.

Better concurrency performance

Setting GOMAXPROCS=N (where N is your number of CPUs) works well in Go 1.5.

Better performance executing goroutines in parallel:

Better perfomance switching between goroutines in serial:

Better concurrency performance (bottom line)

Better performance under practical workloads:

And our benchmark suite:

Go 1.5 overall performance

Go 1.5 overall performance (continued)

OS/Arch ports

Go 1.5 supports some new GOOS/GOARCH combinations:

  • darwin/arm , a.k.a iOS
  • darwin/arm64 (newer iDevices)
  • linux/arm64 (cgo is supported, but only with external linking)
  • openbsd/arm (no cgo or external linking)

And retires some old ones:

DragonflyBSD dropped support for i386; dragonfly/386 was removed from Go.

Apple no longer supports OS X 10.6 (no security updates since 2013);the Go port to OS X 10.6 (Snow Leopard) is no longer actively maintained.

Shared libraries

Go 1.5 can produce Go shared libraries that can be consumed by Go programs.

Build the standard library as shared libraries:

$ go install -buildmode=shared std

Build a "Hello, world" program that links against the shared libraries:

$ go build -linkshared hello.go
$ ls -l hello
-rwxr-xr-x 1 adg adg 13926 May 26 02:13 hello

Go 1.5 can also build Go programs as C archive files (for static linking)or shared libraries (for dynamic linking) that can be consumed by C programs.

/s/execmodes

(Demo)

Go programs as C libraries

Given a package:

package p // import "p"

import "C"

//export Foo
func Foo() int32 { return 42 }

And a main package that imports it:

package main // import "m"

import _ "p"

func main() {} // ignored

You can build an archive file that can be linked into a C program:

$ go build -buildmode=c-archive m
$ ls $GOPATH/pkg/linux_amd64
m.a  p.a  p.h

A minor language change

You may now omit the key type from a map literal.

This map literal

m := map[Point]string{
    Point{29.935523, 52.891566}:   "Persepolis",
    Point{-25.352594, 131.034361}: "Uluru",
    Point{37.422455, -122.084306}: "Googleplex",
}

may now be written as:

m := map[Point]string{
    {29.935523, 52.891566}:   "Persepolis",
    {-25.352594, 131.034361}: "Uluru",
    {37.422455, -122.084306}: "Googleplex",
}

"go doc"

The go tool has a new implementation of the old doc subcommand,

with a much improved command-line interface:

$ go doc zip.reader
package zip // import "archive/zip"
type Reader struct {
  File	[]*File
  Comment string
  // Has unexported fields.
}
func NewReader(r io.ReaderAt, size int64) (*Reader, error)
$ cd $GOROOT/src/archive/zip
$ go doc reader
# same output as above

(Demo)

Analysis and Refactoring Tools

We have been working on tools for analyzing and manipulating Go source code.

Analysis tools:

  • oracle : a tool for answering questions about Go source code (w/ plugins for Sublime Text and Emacs).
  • callgraph : display the call graph of a Go program.
  • godoc -analysis=pointer: see pointer analysis details in godoc.

Refactoring tools:

  • eg : a template-based refactoring tool
  • gorename : type-safe renaming of identifiers in Go source code.

Builder infrastructure

We have been hacking away at our continuous build infrastructure.

Now running Linux, Windows, OS X, FreeBSD, OpenBSD, and Plan 9 builderson Google Compute Engine.

Spin up builders to do work, spin up many in parallel.Gives us results much faster.

Sharding of tests on slower platforms (eg, ARM).

Trybots test pending changes. (Demo)

Mobile

Go 1.5 provides support for Android and experimental support for iOS.

The gomobile tool

The gomobile tool simplifies SDK installation and app deployment.

(It only supports Android right now.)

To install the Android compiler toolchain:

$ gomobile init

To build an Android APK and install on a device:

$ gomobile install

To build a shared library for an Android or iOS app:

$ gomobile bind

(Demo)

Go community events

  • GoCon, Tokyo, June
  • GopherCon, Denver, July
  • GolangUK, London, August
  • GothamGo, New York, October
  • dotGo, Paris, November

And more to be announced.

Thank you

Andrew Gerrand

adg@

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多