|
I made a few web application servers (mostly for games) and it's been a real pleasure, not to mention that my programs run for months handling millions of queries (mostly json) without the slightest problem. Using the go tool to get libraries, build, compile, test, benchmark, is like a dream. An example of what I found kind of marvelous : I had sometimes queries leading to the call to a function updating a lot of things in a kind of specific database. That is the browser had to wait about 1 second because there was in the query handling code something like this : for _, ami := range amis {
bra.EnrichitCouchePNG(ms.répertoireCartesBraldun(ami.IdBraldun, ami.Mdpr), couche, PNG_CACHE_SIZE)
}
I just made a tiny change and the work was done after the answer was sent to the browser : for _, ami := range amis {
go bra.EnrichitCouchePNG(ms.répertoireCartesBraldun(ami.IdBraldun, ami.Mdpr), couche, PNG_CACHE_SIZE)
}
This small go was the only needed thing (the "database" being yet protected by a mutex) |