SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Downloaden Sie, um offline zu lesen
www.cloudflare.com!
Highlights of Go 1.1
May 29, 2013
John Graham-Cumming
www.cloudflare.com!
Method Values
•  Function value bound to specific receiver
type Prefixer struct {!
prefix string!
}!
!
func (p Prefixer) Add(s string) string {!
return p.prefix + ": " + s!
}!
!
func main() {!
hawaii := Prefixer{"Aloha”}!
fmt.Printf("%sn", hawaii.Add("Welcome to Honolulu"))!
!
adder := hawaii.Add!
fmt.Printf("%sn", adder("Welcome to Honolulu"))!
}!
www.cloudflare.com!
Change to return handling
•  return statement not needed at end of functions if
function termination is unambiguous
•  Worth reading the specification on ‘terminating
statements’
•  http://golang.org/ref/spec#Terminating_statements

func even() int {!
for {!
if i := rand.Intn(100); i%2 == 0 {!
return i!
}!
}!
}!
www.cloudflare.com!
bufio.Scanner
•  Simple, fast type for doing command tasks like reading
os.Stdin line by line, or reading word by word from a
file
•  Built in scanners for lines, words, characters and runes
•  Can provide a custom scanner function
scanner := bufio.NewScanner(os.Stdin)!
!
for scanner.Scan() {!
fmt.Println(scanner.Text()!
}!
!
if err := scanner.Err(); err != nil {!
// Handle error!
}!
www.cloudflare.com!
Size of int
•  On 64-bit platforms int and uint are now 64 bits
•  Elsewhere they are 32-bits.

•  Couple of consequences:
•  If your code was relying on them being 32-bits then you may have
trouble

•  Slice indexes are ints which means they can have 2 billion
members

x := ^uint32(0) !// x is 0xffffffff!
i := int(x) !// i is -1 on 32-bit systems, !
! ! !// 0xffffffff on 64-bit!
fmt.Println(i)!
www.cloudflare.com!
Heap size and Platforms
•  On 64-bit machines heap can now be tens of GB
•  No change on 32-bit
•  If you were running off tip in recent months you already
had massive heaps
•  Experimental support for: linux/arm, freebsd/arm,
netbsd/386, amd64 and arm, openbsd/386 and
amd64
www.cloudflare.com!
Nanosecond timing 

•  FreeBSD, Linux, NetBSD, OpenBSD, OS X time package
has nanosecond precision
•  time.Round and time.Truncate to round up/down to
nearest multiples of any time.Duration
t, _ := time.Parse("2006 Jan 02 15:04:05", "2012 Dec
07 12:15:30.918273645")!
trunc := []time.Duration{!
time.Nanosecond, time.Microsecond,!
time.Millisecond, time.Second,!
2 * time.Second, time.Minute,!
10 * time.Minute, time.Hour, !
}!
for _, d := range trunc {!
fmt.Printf("t.Truncate(%6s) = %sn", d,
t.Truncate(d).Format("15:04:05.999999999"))!
}!
www.cloudflare.com!
Performance
•  Claimed 30 to 40% performance increase over Go 1.0.3

•  Best analysis by Dave Cheney:
•  http://dave.cheney.net/2013/05/21/go-11-performance-
improvements
•  http://dave.cheney.net/2013/05/25/go-11-performance-
improvements-part-2
•  http://dave.cheney.net/2013/05/28/go-11-performance-
improvements-part-3

•  Dave’s summary: 30-40% performance increase is real
www.cloudflare.com!
Performance Highlights
•  Code generation improvements across all three gc
compilers
•  Improvements to inlining
•  Reduction in stack usage
•  Parallel garbage collector. 
•  More precise garbage collection, which reduces the size
of the heap, leading to lower GC pause times.
•  New runtime scheduler; tight integration of the scheduler
with the net package
•  Parts of the runtime and standard library have been
rewritten in assembly to take advantage of specific bulk
move or crypto instructions.
www.cloudflare.com!
Race Detector 

•  http://golang.org/doc/articles/race_detector.html
•  Detects concurrent access by two goroutines to the
same variable where one access is write
•  go build –race example.go
func main() {!
c := make(chan bool)!
m := make(map[string]string)!
!
go func() {!
m["1"] = "a" // First conflicting access.!
c <- true!
}()!
!
m["2"] = "b" // Second conflicting access.!
<-c!
}!
www.cloudflare.com!
Full release notes
•  http://golang.org/doc/go1.1

•  Go 1.1 is backwards compatible with Go 1.0.3

•  Go 1.2 targeted for December 1

Weitere ähnliche Inhalte

Was ist angesagt?

Python code for the determination of equivalent horizontal and vertical hydra...
Python code for the determination of equivalent horizontal and vertical hydra...Python code for the determination of equivalent horizontal and vertical hydra...
Python code for the determination of equivalent horizontal and vertical hydra...Joyson Parmar
 
Class 24: Imperative Programming
Class 24: Imperative ProgrammingClass 24: Imperative Programming
Class 24: Imperative ProgrammingDavid Evans
 
Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbu...
Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbu...Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbu...
Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbu...Magento Meetup Wrocław
 
Algorithm cup 2010
Algorithm cup 2010Algorithm cup 2010
Algorithm cup 2010Wizche
 
Actor Based Asyncronous IO in Akka
Actor Based Asyncronous IO in AkkaActor Based Asyncronous IO in Akka
Actor Based Asyncronous IO in Akkadrewhk
 
Cypher for Gremlin
Cypher for GremlinCypher for Gremlin
Cypher for GremlinopenCypher
 
LLVM Workshop Osaka Umeda, Japan
LLVM Workshop Osaka Umeda, JapanLLVM Workshop Osaka Umeda, Japan
LLVM Workshop Osaka Umeda, Japanujihisa
 
HTTP and 5G partial draft
HTTP and 5G partial draftHTTP and 5G partial draft
HTTP and 5G partial draftdynamis
 
用 Bitbar Tool 寫 Script 自動擷取外幣
用 Bitbar Tool 寫 Script 自動擷取外幣用 Bitbar Tool 寫 Script 自動擷取外幣
用 Bitbar Tool 寫 Script 自動擷取外幣Win Yu
 
Implementation of Bitcoin Miner on SW and HW
Implementation of Bitcoin Miner on SW and HWImplementation of Bitcoin Miner on SW and HW
Implementation of Bitcoin Miner on SW and HWJoe Jiang
 
Heroku's Ryan Smith at Waza 2013: Predictable Failure
Heroku's Ryan Smith at Waza 2013: Predictable FailureHeroku's Ryan Smith at Waza 2013: Predictable Failure
Heroku's Ryan Smith at Waza 2013: Predictable FailureHeroku
 
Nasamatic NewHaven.IO 2014 05-21
Nasamatic NewHaven.IO 2014 05-21Nasamatic NewHaven.IO 2014 05-21
Nasamatic NewHaven.IO 2014 05-21Prasanna Gautam
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methodsjwjablonski
 

Was ist angesagt? (20)

user2015 keynote talk
user2015 keynote talkuser2015 keynote talk
user2015 keynote talk
 
Python code for the determination of equivalent horizontal and vertical hydra...
Python code for the determination of equivalent horizontal and vertical hydra...Python code for the determination of equivalent horizontal and vertical hydra...
Python code for the determination of equivalent horizontal and vertical hydra...
 
Class 24: Imperative Programming
Class 24: Imperative ProgrammingClass 24: Imperative Programming
Class 24: Imperative Programming
 
Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbu...
Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbu...Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbu...
Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbu...
 
Algorithm cup 2010
Algorithm cup 2010Algorithm cup 2010
Algorithm cup 2010
 
GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
 
Storm
StormStorm
Storm
 
Actor Based Asyncronous IO in Akka
Actor Based Asyncronous IO in AkkaActor Based Asyncronous IO in Akka
Actor Based Asyncronous IO in Akka
 
Cypher for Gremlin
Cypher for GremlinCypher for Gremlin
Cypher for Gremlin
 
Internet of dusty things
Internet of dusty thingsInternet of dusty things
Internet of dusty things
 
LLVM Workshop Osaka Umeda, Japan
LLVM Workshop Osaka Umeda, JapanLLVM Workshop Osaka Umeda, Japan
LLVM Workshop Osaka Umeda, Japan
 
HTTP and 5G partial draft
HTTP and 5G partial draftHTTP and 5G partial draft
HTTP and 5G partial draft
 
Libtcc and gwan
Libtcc and gwanLibtcc and gwan
Libtcc and gwan
 
用 Bitbar Tool 寫 Script 自動擷取外幣
用 Bitbar Tool 寫 Script 自動擷取外幣用 Bitbar Tool 寫 Script 自動擷取外幣
用 Bitbar Tool 寫 Script 自動擷取外幣
 
scikit-cuda
scikit-cudascikit-cuda
scikit-cuda
 
Implementation of Bitcoin Miner on SW and HW
Implementation of Bitcoin Miner on SW and HWImplementation of Bitcoin Miner on SW and HW
Implementation of Bitcoin Miner on SW and HW
 
Heroku's Ryan Smith at Waza 2013: Predictable Failure
Heroku's Ryan Smith at Waza 2013: Predictable FailureHeroku's Ryan Smith at Waza 2013: Predictable Failure
Heroku's Ryan Smith at Waza 2013: Predictable Failure
 
Nasamatic NewHaven.IO 2014 05-21
Nasamatic NewHaven.IO 2014 05-21Nasamatic NewHaven.IO 2014 05-21
Nasamatic NewHaven.IO 2014 05-21
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methods
 
Sol6
Sol6Sol6
Sol6
 

Ähnlich wie Go 1.1 Highlights Performance Boosts and New Features

An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to GoCloudflare
 
Go Concurrency
Go ConcurrencyGo Concurrency
Go Concurrencyjgrahamc
 
Go, the one language to learn in 2014
Go, the one language to learn in 2014Go, the one language to learn in 2014
Go, the one language to learn in 2014Andrzej Grzesik
 
JDD2014: GO! The one language you have to try in 2014 - Andrzej Grzesik
JDD2014: GO! The one language you have to try in 2014 - Andrzej GrzesikJDD2014: GO! The one language you have to try in 2014 - Andrzej Grzesik
JDD2014: GO! The one language you have to try in 2014 - Andrzej GrzesikPROIDEA
 
Painless Data Storage with MongoDB & Go
Painless Data Storage with MongoDB & Go Painless Data Storage with MongoDB & Go
Painless Data Storage with MongoDB & Go Steven Francia
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonAlex Payne
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of GoFrank Müller
 
#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and Protocols#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and ProtocolsPhilippe Back
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptxGuy Komari
 
Go Concurrency
Go ConcurrencyGo Concurrency
Go ConcurrencyCloudflare
 
Hadoop Streaming: Programming Hadoop without Java
Hadoop Streaming: Programming Hadoop without JavaHadoop Streaming: Programming Hadoop without Java
Hadoop Streaming: Programming Hadoop without JavaGlenn K. Lockwood
 
Go Containers
Go ContainersGo Containers
Go Containersjgrahamc
 
Introduction to go
Introduction to goIntroduction to go
Introduction to goJaehue Jang
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP PerspectiveBarry Jones
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoJaehue Jang
 
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티JaeYeoul Ahn
 
Crunching data with go: Tips, tricks, use-cases
Crunching data with go: Tips, tricks, use-casesCrunching data with go: Tips, tricks, use-cases
Crunching data with go: Tips, tricks, use-casesSergii Khomenko
 

Ähnlich wie Go 1.1 Highlights Performance Boosts and New Features (20)

An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
 
Go Concurrency
Go ConcurrencyGo Concurrency
Go Concurrency
 
Go, the one language to learn in 2014
Go, the one language to learn in 2014Go, the one language to learn in 2014
Go, the one language to learn in 2014
 
JDD2014: GO! The one language you have to try in 2014 - Andrzej Grzesik
JDD2014: GO! The one language you have to try in 2014 - Andrzej GrzesikJDD2014: GO! The one language you have to try in 2014 - Andrzej Grzesik
JDD2014: GO! The one language you have to try in 2014 - Andrzej Grzesik
 
Painless Data Storage with MongoDB & Go
Painless Data Storage with MongoDB & Go Painless Data Storage with MongoDB & Go
Painless Data Storage with MongoDB & Go
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
 
#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and Protocols#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and Protocols
 
golang_getting_started.pptx
golang_getting_started.pptxgolang_getting_started.pptx
golang_getting_started.pptx
 
Go Concurrency
Go ConcurrencyGo Concurrency
Go Concurrency
 
Briefly Rust
Briefly RustBriefly Rust
Briefly Rust
 
Hadoop Streaming: Programming Hadoop without Java
Hadoop Streaming: Programming Hadoop without JavaHadoop Streaming: Programming Hadoop without Java
Hadoop Streaming: Programming Hadoop without Java
 
Go Containers
Go ContainersGo Containers
Go Containers
 
Go Containers
Go ContainersGo Containers
Go Containers
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP Perspective
 
go.ppt
go.pptgo.ppt
go.ppt
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
Go 프로그래밍 소개 - 장재휴, DomainDriven커뮤니티
 
Crunching data with go: Tips, tricks, use-cases
Crunching data with go: Tips, tricks, use-casesCrunching data with go: Tips, tricks, use-cases
Crunching data with go: Tips, tricks, use-cases
 

Mehr von jgrahamc

Better living through microcontrollers
Better living through microcontrollersBetter living through microcontrollers
Better living through microcontrollersjgrahamc
 
Big O London Meetup April 2015
Big O London Meetup April 2015Big O London Meetup April 2015
Big O London Meetup April 2015jgrahamc
 
How to launch and defend against a DDoS
How to launch and defend against a DDoSHow to launch and defend against a DDoS
How to launch and defend against a DDoSjgrahamc
 
Lua: the world's most infuriating language
Lua: the world's most infuriating languageLua: the world's most infuriating language
Lua: the world's most infuriating languagejgrahamc
 
Software Debugging for High-altitude Balloons
Software Debugging for High-altitude BalloonsSoftware Debugging for High-altitude Balloons
Software Debugging for High-altitude Balloonsjgrahamc
 
That'll never work!
That'll never work!That'll never work!
That'll never work!jgrahamc
 
HAB Software Woes
HAB Software WoesHAB Software Woes
HAB Software Woesjgrahamc
 
Javascript Security
Javascript SecurityJavascript Security
Javascript Securityjgrahamc
 

Mehr von jgrahamc (9)

Better living through microcontrollers
Better living through microcontrollersBetter living through microcontrollers
Better living through microcontrollers
 
Big O London Meetup April 2015
Big O London Meetup April 2015Big O London Meetup April 2015
Big O London Meetup April 2015
 
How to launch and defend against a DDoS
How to launch and defend against a DDoSHow to launch and defend against a DDoS
How to launch and defend against a DDoS
 
Lua: the world's most infuriating language
Lua: the world's most infuriating languageLua: the world's most infuriating language
Lua: the world's most infuriating language
 
Software Debugging for High-altitude Balloons
Software Debugging for High-altitude BalloonsSoftware Debugging for High-altitude Balloons
Software Debugging for High-altitude Balloons
 
Go memory
Go memoryGo memory
Go memory
 
That'll never work!
That'll never work!That'll never work!
That'll never work!
 
HAB Software Woes
HAB Software WoesHAB Software Woes
HAB Software Woes
 
Javascript Security
Javascript SecurityJavascript Security
Javascript Security
 

Kürzlich hochgeladen

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Kürzlich hochgeladen (20)

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

Go 1.1 Highlights Performance Boosts and New Features

  • 1. www.cloudflare.com! Highlights of Go 1.1 May 29, 2013 John Graham-Cumming
  • 2. www.cloudflare.com! Method Values •  Function value bound to specific receiver type Prefixer struct {! prefix string! }! ! func (p Prefixer) Add(s string) string {! return p.prefix + ": " + s! }! ! func main() {! hawaii := Prefixer{"Aloha”}! fmt.Printf("%sn", hawaii.Add("Welcome to Honolulu"))! ! adder := hawaii.Add! fmt.Printf("%sn", adder("Welcome to Honolulu"))! }!
  • 3. www.cloudflare.com! Change to return handling •  return statement not needed at end of functions if function termination is unambiguous •  Worth reading the specification on ‘terminating statements’ •  http://golang.org/ref/spec#Terminating_statements func even() int {! for {! if i := rand.Intn(100); i%2 == 0 {! return i! }! }! }!
  • 4. www.cloudflare.com! bufio.Scanner •  Simple, fast type for doing command tasks like reading os.Stdin line by line, or reading word by word from a file •  Built in scanners for lines, words, characters and runes •  Can provide a custom scanner function scanner := bufio.NewScanner(os.Stdin)! ! for scanner.Scan() {! fmt.Println(scanner.Text()! }! ! if err := scanner.Err(); err != nil {! // Handle error! }!
  • 5. www.cloudflare.com! Size of int •  On 64-bit platforms int and uint are now 64 bits •  Elsewhere they are 32-bits. •  Couple of consequences: •  If your code was relying on them being 32-bits then you may have trouble •  Slice indexes are ints which means they can have 2 billion members x := ^uint32(0) !// x is 0xffffffff! i := int(x) !// i is -1 on 32-bit systems, ! ! ! !// 0xffffffff on 64-bit! fmt.Println(i)!
  • 6. www.cloudflare.com! Heap size and Platforms •  On 64-bit machines heap can now be tens of GB •  No change on 32-bit •  If you were running off tip in recent months you already had massive heaps •  Experimental support for: linux/arm, freebsd/arm, netbsd/386, amd64 and arm, openbsd/386 and amd64
  • 7. www.cloudflare.com! Nanosecond timing •  FreeBSD, Linux, NetBSD, OpenBSD, OS X time package has nanosecond precision •  time.Round and time.Truncate to round up/down to nearest multiples of any time.Duration t, _ := time.Parse("2006 Jan 02 15:04:05", "2012 Dec 07 12:15:30.918273645")! trunc := []time.Duration{! time.Nanosecond, time.Microsecond,! time.Millisecond, time.Second,! 2 * time.Second, time.Minute,! 10 * time.Minute, time.Hour, ! }! for _, d := range trunc {! fmt.Printf("t.Truncate(%6s) = %sn", d, t.Truncate(d).Format("15:04:05.999999999"))! }!
  • 8. www.cloudflare.com! Performance •  Claimed 30 to 40% performance increase over Go 1.0.3 •  Best analysis by Dave Cheney: •  http://dave.cheney.net/2013/05/21/go-11-performance- improvements •  http://dave.cheney.net/2013/05/25/go-11-performance- improvements-part-2 •  http://dave.cheney.net/2013/05/28/go-11-performance- improvements-part-3 •  Dave’s summary: 30-40% performance increase is real
  • 9. www.cloudflare.com! Performance Highlights •  Code generation improvements across all three gc compilers •  Improvements to inlining •  Reduction in stack usage •  Parallel garbage collector. •  More precise garbage collection, which reduces the size of the heap, leading to lower GC pause times. •  New runtime scheduler; tight integration of the scheduler with the net package •  Parts of the runtime and standard library have been rewritten in assembly to take advantage of specific bulk move or crypto instructions.
  • 10. www.cloudflare.com! Race Detector •  http://golang.org/doc/articles/race_detector.html •  Detects concurrent access by two goroutines to the same variable where one access is write •  go build –race example.go func main() {! c := make(chan bool)! m := make(map[string]string)! ! go func() {! m["1"] = "a" // First conflicting access.! c <- true! }()! ! m["2"] = "b" // Second conflicting access.! <-c! }!
  • 11. www.cloudflare.com! Full release notes •  http://golang.org/doc/go1.1 •  Go 1.1 is backwards compatible with Go 1.0.3 •  Go 1.2 targeted for December 1