feyeleanor / gospeed Goto Github PK
View Code? Open in Web Editor NEWGo micro-benchmarks for calculating the speed of language constructs
License: Other
Go micro-benchmarks for calculating the speed of language constructs
License: Other
== About == GoSpeed is a library of micro-benchmarks for Go which evolved from the GoLightly project. It's main utility is for understanding and reasoning about the performance of Go programs. == Usage == Download the repo to a convenient location in your $GOPATH git clone [email protected]:feyeleanor/gospeed.git or install it to pkg/mod go get github.com/feyeleanor/GoSpeed On macOS/Linux run the benchmarks with: go test -test.bench=".*" or on Windows go test -bench .* If you're running on older hardware such as an Intel Atom N270 netbook (which the early versions of GoSpeed were developed on) then you may also need to add a custom timeout to complete benchmarks which make significant use of channels as the default aggregate test timeout is ten minutes. On macOS/Linux go test -test.bench=".*" -test.timeout="60m" on Windows go test -bench .* -timeout 60m
I encountered a out of memory error when running the full benchmark. Obviously not your fault, but just wanted to give you a heads up.
It seems the memory overhead for creating a mere 500 000 go routines required more than my 4GB. I added another 1GB of swap just to test and it still crashed with an OOM.
The issue is reproducible on my machine by running the benchmarks with
$ go test -v -test.bench=".*"
which would throw out the following when hitting the BaselineGo benchmark.
throw: out of memory (FixAlloc)
goroutine 1 [chan receive]:
testing.(*B).run(0xf8400730a0, 0x9732500000003, 0x7ff66dc53e10, 0x100000001)
/home/simon/lib/golang/src/pkg/testing/benchmark.go:133 +0x49
testing.RunBenchmarks(0x400c00, 0x571850, 0x6700000067, 0x0)
/home/simon/lib/golang/src/pkg/testing/benchmark.go:244 +0x4c1
testing.Main(0x400c00, 0x56c528, 0x100000001, 0x571850, 0x6700000067, ...)
/home/simon/lib/golang/src/pkg/testing/testing.go:293 +0x180
main.main()
/tmp/go-build113068524/github.com/feyeleanor/gospeed/_test/_testmain.go:249 +0x91
goroutine 2 [syscall]:
created by runtime.main
/home/simon/lib/golang/src/pkg/runtime/proc.c:221
goroutine 54 [running]:
github.com/feyeleanor/gospeed.BenchmarkBaselineGo(0xf8400730a0, 0x41f661)
/home/simon/src/github.com/feyeleanor/gospeed/baseline_benchmark_test.go:282 +0x37
testing.(*B).runN(0xf8400730a0, 0xf4240, 0x2710000f4240, 0xbabf2000babf2)
/home/simon/lib/golang/src/pkg/testing/benchmark.go:84 +0x4e
testing.(*B).launch(0xf8400730a0, 0x0)
/home/simon/lib/golang/src/pkg/testing/benchmark.go:169 +0x147
created by testing.(*B).run
/home/simon/lib/golang/src/pkg/testing/benchmark.go:132 +0x2c
Simply running
$ go test -v -test.bench="BaselineGo"
would not reproduce the error, but still consume a lot of memory.
P.S. Thanks for the nice benchmarks. Really helps when you'd like to know how the basic constructs of the language perform.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.