fasthttp; Optimized memory allocation

This commit is contained in:
DarthSim
2018-10-05 21:17:36 +06:00
parent 6e8933198f
commit 34a61d287f
95 changed files with 23591 additions and 179 deletions

13
main.go
View File

@@ -1,20 +1,21 @@
package main
import (
"log"
"os"
"os/signal"
"runtime/debug"
"time"
"net/http"
_ "net/http/pprof"
)
const version = "2.0.0"
type ctxKey string
func main() {
// Force garbage collection
go func() {
for range time.Tick(10 * time.Second) {
debug.FreeOSMemory()
}
log.Println(http.ListenAndServe("localhost:6060", nil))
}()
s := startServer()