Giter VIP home page Giter VIP logo

go_concurrency_patterns_2012's Introduction

Google I/O 2012 - Go Concurrency Patterns Code

The code in this repository implements and orders all the major code examples referenced in Rob Pike's talk found here.

I have refactored it for clarity when possible as well as implemented enhancements.

Enhancements

Variadic and Slice Versions of fanIn Function

In the talk, Pike only covers a version of fanIn with a set number of two input channels. I implement two versions that can accept an arbitrary number of channels:

  • variadicFanIn in 07_variadicFanIn.go
  • sliceFanIn in 08_sliceFanIn.go

In 11_sliceSelect.go, I iterate on this to have one just call the other.

Slice select

Pike only covers use of select for a set number of channels. I implement a select on an arbitrarily sized slice of input channels in 11_sliceSelect.go.

Google 3.5

Pike gets to Google 3.0 in his talk, which uses two replicas of each type of his simulated Google search. On my machine, this version still regularly failed the 80ms timeout. So I created a version in 17_googleSearch.go called Google3_5 that uses slices of 10 replicas per type and, not surprisingly, gets better performance than Pike's final version in the talk, sometimes sub-millisecond on my machine.

go_concurrency_patterns_2012's People

Contributors

drgrib avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.