Linked by Thom Holwerda on Wed 28th Mar 2012 19:22 UTC
General Development "Today marks a major milestone in the development of the Go programming language. We're announcing Go version 1, or Go 1 for short, which defines a language and a set of core libraries to provide a stable foundation for creating reliable products, projects, and publications. Go 1 is the first release of Go that is available in supported binary distributions. They are available for Linux, FreeBSD, Mac OS X and, we are thrilled to announce, Windows."
Thread beginning with comment 512403
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[4]: Too bad it is so slow
by kalcytriol on Fri 30th Mar 2012 01:35 UTC in reply to "RE[3]: Too bad it is so slow"
kalcytriol
Member since:
2011-04-23

Without chunking:
19k RPS. not bad, but still below level of ecceptance.
330% diference. I could accept 50% max
Incresed CPU time = wasted money.


Both response headers:
--------------------------------------------------- C Serv
HTTP/1.1 200 OK
Server: G-WAN
Date: Thu, 29 Mar 2012 23:47:36 GMT
Last-Modified: Thu, 29 Mar 2012 23:47:36 GMT
Etag: "441d9cc1-4f74f498-b"
Vary: Accept-Encoding
Accept-Ranges: bytes
Content-Type: text/html; charset=UTF-8
Content-Length: 11
Connection: Keep-Alive
---------------------------------------------------- Go
HTTP/1.1 200 OK
Content-Length: 11
Content-Type: text/plain
Date: Fri, 30 Mar 2012 01:16:24 GMT
----------------------------------------------------------

BTW do you know any other optimization tricks?

Another thing is a heavy lack of documentation. I wasted a lot of time just to find how to write to header. Yes, Id found it but in some other part of internet. At least their search engine is fine (Google).

Reply Parent Score: 1

RE[5]: Too bad it is so slow
by voidlogic on Fri 30th Mar 2012 18:34 in reply to "RE[4]: Too bad it is so slow"
voidlogic Member since:
2005-09-03

"BTW do you know any other optimization tricks?"
I'd be happy to take a look, can you post a link to your latest code?

As far as documentation, check out http://golang.org/pkg/

Specifically regarding headers: http://golang.org/pkg/net/http/#Header

Reply Parent Score: 2

RE[6]: Too bad it is so slow
by kalcytriol on Fri 30th Mar 2012 23:07 in reply to "RE[5]: Too bad it is so slow"
kalcytriol Member since:
2011-04-23

Nothing special, just:

GOMAXPROCS=4
hello.go ----------------------------------------------
package main

import (
"net/http"
"fmt"
"strconv"
)

var hellostr string="HelloWorld"
var hellolen string=strconv.Itoa(len(hellostr))

func handler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain; charset=UTF-8")
w.Header().Set("Content-Length", hellolen) // this icreases server performance 2x ,from 11kRPS to 22k RPS (requests per second)
fmt.Fprintf(w, hellostr);
}

func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}
---------------------------------------------------

Reply Parent Score: 1