A home for Philly Gophers
See all
Members (21)

Stream

Dan Worth
owner

Discussion  - 
 
December Meetup Lightning talk
1
Add a comment...
 
Here is my lightning talk on creating a simple protected website in go on Google AppEngine

https://docs.google.com/presentation/d/1AYX2FUpEqpHgSZV_A4ydEBVmkFw9XlebdYDNp1pL3gA/edit?usp=sharing
1
Gilad Raphaelli's profile photo
 
Thanks Darrel, very handy!
Add a comment...

Dan Worth
owner

Discussion  - 
 
 
TL;DR: My simple web API is 10X 50X faster (and uses 10X less memory) after being rewritten in #Golang   (benchmarked #Rails   API vs Pat/Go).

Update: +James Tucker pointed out that jmeter might not be fast enough to benchmark my Go web API and I should have used wrk. I tried as per his suggestions and he's right, I'm getting a much higher throughput. I originally reported a 10X improvement, it really was a 50X improvement.

4 threads and 20 connections
Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     5.88ms    8.41ms  36.76ms   78.48%
    Req/Sec     0.99k    97.22     1.00k    99.05%
93852 requests in 20.00s, 19.15MB read
Requests/sec:   4691.79

----

I've always liked #Golang  and I'm impressed by how much/fast the Go core team keep on improving the language, implementation, and documentation. Things are much easier now in Goland.
With version 1.1 and 1.1.1 being released I wanted to see how easy it would be to start using Go in my daily workflow. By that I mean that until now, I only "played" with Go, I wrote a few small apps for fun but no nothing mission critical.

My goal was to write 2 web json APIs, one using Rails and a port in Go. The API would be simple and do a few things:
* extract the Authentication header from the request
* verify it against the DB (mysql)
* and render a json representation of the user object.

The Rails app was written in no time but the Go one took a bit longer. I chose to use the Revel framework since I like Play (Scala framework) and Revel is a port. Unfortunately that was a mistake. The lack of documentation, the odd features and the lack of simple cross platform deployment made me give up the framework approach. To be honest, I should add that +Andrew Gerrand (easily) convinced me that I should keep it simple and just stick to pure Go. (discussion over on #shitfire  (freenode).

Rewriting the few things and conventions I like took me less than an hour or so, I ended up using +Blake Mizerany's Pat package (Sinatra like pattern muxer https://github.com/bmizerany/pat ). 

My code is simpler, more flexible and easily cross compiles.
The next step was to benchmark the 2 APIs under load. I knew that Go was going to be considerably faster and I knew that benchmarking on my own machine wouldn't yield scientific results. That said, I fired up jmeter and run 20 threads/users making 1000 queries and looked at the results.

Go web API:
20,000 samples
0 errors
Average: 8ms
Median: 5ms
 90%: 20ms
Max: 90ms
Min: 1ms
Throughput: 1202.2 requests/s 4691.79 requests/s (see update) 
Memory usage: 10MBs

Rails (Rails 4, Ruby 2.0, production mode, puma web server):
20,000 samples
0 errors
Average: 187ms
Median: 163ms
 90%: 214ms
Min: 9ms
Max: 178,552ms (442ms most of the time but big spike around 15,000 requests)
Throughput: 88.9 requests/s
Memory usage: 117MBs
(server was warmed up and the benchmarks were run multiple times, delta stayed within 5 ms)

The numbers in themselves aren't that important. Running the same benchmark on a linux machine and on AWS will obviously yield slightly different numbers. What's interested in that the performance difference between Go and Ruby in this specific use case is 10X.
10X is a LOT. There is no way I could tweak the Ruby code to get close to the Go numbers. For many use cases, it wouldn't matter, but if performance is important, then choosing Go might make a lot of sense. Note also that the response time is more than 10X faster with Go.

Finally, here are more scientific and detailed comparison benchmarks (Rails, Sinatra, Revel, JRuby etc..): http://www.techempower.com/benchmarks/#section=data-r5&p=3q
1
Add a comment...

Darrel Herbst

Discussion  - 
 
Here is the lightning talk on JSON serialization in Go
1
Add a comment...
 
A quickstart project for Google glass mirror api using go on appengine.
 
The Google Mirror API quick start projects just got a little bit cuter thanks to the Go Gopher.
1
Add a comment...

Dan Worth

Discussion  - 
 
Yay!  A GopherCon
GopherCon
Thu, April 24, 7:30 AM MDT
Marriot Denver City Center

1
Add a comment...

About this community

A community for the GoLang Philly meetup.
 
In honor of fireside - fireside chat spiced winter ale.
2
Dan Worth's profile photo
 
What are the odds! So cool
Add a comment...

Dan Worth
owner

Discussion  - 
 
 
+Brett Slatkin and I made a video about Camlistore.

More info at http://camlistore.org/

Enjoy!

And +Mathieu Lonjaret, next time we make a status update video we'll need to get you over here.  :-)
1
Add a comment...

Ben Brouse

Discussion  - 
 
Lightning talk: Concurrency case study with Go (Slides, results, and code)

http://prezi.com/f5i3iob-wavu/?utm_campaign=share&utm_medium=copy
1
Add a comment...

Dan Worth
owner

Discussion  - 
 
 
+Mathieu Lonjaret and I, along with the other Camlistore contributors, are proud to announce our very first release, 0.1 (codename "Grenoble"):

http://camlistore.org/docs/release/0.1

See also http://camlistore.org/

Video coming later.

We welcome any and all feedback.

Shoutout to #golang  which made this all painless, and +Brett Slatkin for all early brainstorming and hacking with me, as well as doing so much Closure work.  And +Lindsey Simon for his UI help. It's been a fun 3 years. Hopefully future releases come sooner.  :-)

Thanks!
1
Add a comment...

Dan Worth
owner

Discussion  - 
 
I updated the next meeting with an agenda and more info about the Google Codejam problems.
1
Add a comment...

Dan Worth
owner

Discussion  - 
 
Great talk at Google I/O 2013 about the use of goroutines and channels
 
great talk at google i/o :)
1
Add a comment...

Dan Worth
owner

Discussion  - 
 
Lightning talk on the Reflect package
1
Add a comment...

Dan Worth
owner

Discussion  - 
 
Go Talks at Google I/O 2013
 
The videos for the Go sessions at Google I/O 2013 are now all up:

High Performance Apps with Go on App Engine (David Symonds)
http://youtu.be/fc25ihfXhbg

Advanced Go Concurrency Patterns (Sameer Ajmani)
http://youtu.be/QDDwwePbDtw

Fireside Chat with the Go Team
http://youtu.be/p9VUCp98ay4
1
Add a comment...