func benchmark() driver.Result { if rpcServerAddr == "" { rpc.Register(new(Server)) rpc.RegisterName("Server", new(Server)) l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { log.Fatalf("net.Listen tcp :0: %v", err) } rpcServerAddr = l.Addr().String() go rpc.Accept(l) } return driver.Benchmark(benchmarkN) }
func benchmark() driver.Result { if parsed == nil { mem := packageMemConsumption() avail := (driver.BenchMem << 20) * 4 / 5 // 4/5 to account for non-heap memory npkg := avail / mem / 2 // 2 to account for GOGC=100 parsed = make([]ParsedPackage, npkg) for n := 0; n < 2; n++ { for i := range parsed { parsed[i] = parsePackage() } } fmt.Printf("consumption=%vKB npkg=%d\n", mem>>10, npkg) driver.SetGCPercent(10000) } return driver.Benchmark(benchmarkN) }
func benchmark() driver.Result { return driver.Benchmark(benchmarkHttpImpl) }
func benchmark() driver.Result { return driver.Benchmark(benchmarkN) }