Giter VIP home page Giter VIP logo

gospeed's Introduction

== 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

gospeed's People

Contributors

feyeleanor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gospeed's Issues

OOM

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.