-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to cross-compile using go build #11
Comments
I cannot reproduce this bug on the master branch:
Try updating fasthttp. This bug seems to be fixed in the issue #7 . |
yep that fixed it, thanks! |
@valyala Side note: still getting fairly low results using both apache2 benchmark utils and siege for testing rps. I'm on a 8core 16gb machine, the average is only 1800rps using your sample code from the Full code for your reference:
|
The code above can be optimized. Substitute helloWorldStr := fmt.Sprintf("num of cpu: %v", runtime.NumCPU())
helloWorldBytes := []byte(helloWorldStr)
ctx.Success("text/plain", helloWorldBytes) with fmt.Fprintf(ctx, "num of cpu: %d", runtime.NumCPU())
ctx.SetContentType("text/plain") This way you avoid two memory allocations and two memory copies - one for the string returned from The program can be further optimized by calculating var helloWorldBytes = []byte(fmt.Sprintf("num of cpu: %v", runtime.NumCPU())) As for low results I suspect there are problems with network settings on your OS. Read this article (the first article I found when googling for Fasthttp achieves 1.4M rps in TechEmpower's plaintext benchmark on my laptop when using wrk with 16 connections and 256 pipelined requests. |
Trying to compile for linux
$ env GOOS=linux GOARCH=arm go build -v github.com/abacaj/fasthttp
produces the following error:
# github.com/valyala/fasthttp
C:\Projects\Go\src\github.com\valyala\fasthttp\bytesconv.go:20: constant 18446744073709551615 overflows uint
C:\Projects\Go\src\github.com\valyala\fasthttp\bytesconv.go:33: constant 18446744073709551615 overflows uint
seems like a bug, but not sure - I'm on GO 1.5.1
The text was updated successfully, but these errors were encountered: