--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Alongside the use of append (which will no doubt require lots of resizing), there's also your Postgres configuration: max connections being the big one in a simple case like this.
On Tuesday, June 24, 2014 10:39:10 PM UTC+9, Konstantin Khomoutov wrote:On Tue, 24 Jun 2014 06:28:41 -0700 (PDT)shouich...@gmail.com wrote:
> I inspected using runtime package and found that the most time
> consuming part was "rows.Next()" line, which doesn't make any sense
> for me
> Can you state what version of Go you are running and what your GOMAXPROCS is?
The go version is go1.3 linux/amd64. GOMAXPROCS is not set neither by runtime.GOMAXPROCS() nor env var.
Setting runtime.GOMAXPROCS(runtime.NumCPU()*2) makes it much slower.
Well, I'm not a postgres expert so I re-install postgres 9.3 to make sure that I'm not doing stupid but still slow. Can you tell me exactly what config to change?This is the dump of target database. https://gist.github.com/shouichi/4f60f52ba8381a7a9d9e
users := []user{}with:
Alot of the gain here comes from not doing all the initial grow operations, the closer estUserc is to reality the better you will do.users := make([]user, 0, estUserc)const estUserc = 128
--
Maybe but even with limiting the number of connections the performance continues to degrade as the program continues. Each goroutine takes longer to complete.
While it can make sense I kind of imagined that some sort of steady state would establish itself if the number of connections was limited.
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/0HW4T81tw1Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
Uploaded svg from go tool pprof. The slowest part is ExternalCode (which I don't understand).