Description
Automatic storage and comparison of benchmarks in pretty format
prettybenchcmp alternatives and similar packages
Based on the "Testing" category.
Alternatively, view prettybenchcmp alternatives based on common mentions on social networks and blogs.
-
dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work. -
Testcontainers-go
Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done. -
realize
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading. -
selenoid
DISCONTINUED. Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary. -
hoverfly
Lightweight service virtualization/ API simulation / API mocking tool for developers and testers -
playwright-go
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API. -
gnomock
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻 -
embedded-postgres
Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test -
cdp
Package cdp provides type-safe bindings for the Chrome DevTools Protocol (CDP), written in the Go programming language. -
gotest.tools
A collection of packages to augment the go testing package and support common patterns. -
go-testdeep
Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides tests suite -
testza
Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! 🍕
SaaSHub - Software Alternatives and Reviews
Do you think we are missing an alternative of prettybenchcmp or a related project?
README
prettybenchcmp
prettybenchcmp is cmd tool for storage and comparison of benchmarks results. There is a standard tool benchcmp, but I don't think that the standard programmer will use it because it so boring! Do you doubt?:smirk: Ok, just check instruction for benchcmp! or check "What exactly different from benchcmp". prettybenchcmp simply automates routine and do it good:sparkles:!
How to use
go get github.com/im7mortal/prettybenchcmp
// exec this command in a project directory
prettybenchcmp
//or with test and benchcmp flags
prettybenchcmp -short -benchtime 10s -count 2 -cpu 1,2,4 -changed -mag -best
First time when you use it. It will create .benchHistory file which exist bench history in the special format. Check format of .benchHistory for details
It will return standard output of benchcmp. Like:
benchmark old ns/op new ns/op delta
BenchmarkGetLastBenchmark3651-4 1715 1736 +1.22%
BenchmarkGetLastBenchmark24456-4 1703 1689 -0.82%
benchmark old allocs new allocs delta
BenchmarkGetLastBenchmark3651-4 3 3 +0.00%
BenchmarkGetLastBenchmark24456-4 3 3 +0.00%
benchmark old bytes new bytes delta
BenchmarkGetLastBenchmark3651-4 4224 4224 +0.00%
BenchmarkGetLastBenchmark24456-4 4224 4224 +0.00%
What exactly different from benchcmp
benchcmp use temp files. The goofy moment is that you have to create it yourself:boom:. Furthermore you have to checkout git commits for it and do it carefully:heavy_exclamation_mark:
Different is that prettybenchcmp don't use temp files and keep story in local file .benchHistory. It allow get actual result with one simple action! Enjoy:star:!
Supported flags from "go test"
prettybenchcmp support couple of flags from "go test". It allow pass these flags
- -benchtime
- -count
- -cpu
- -short
Check "go test" documentation for details.
Supported flags from benchcmp
prettybenchcmp support all flags from benchcmp.
- -mag
- -best
- -changed
Check benchcmp documentation for details.
How it work
If .benchHistory doesn't exist.
- It create .benchHistory. Do first benchmark and write it to .benchHistory.
If .benchHistory exist but doesn't exist in git.
- It clean .benchHistory and write current benchmark
If .benchHistory has history
- It parse .benchHistory.
- It check that file has a hash of previous commit which contain .benchHistory changes.
- If true
- it truncate part of file which contain previous benchmark
- else
- it write to file: a separator, previous hash commit which contain .benchHistory changes, current benchmark
Format of .benchHistory
yoshkarola 3235f14078c462b38c4b79912c1e34c868d34049
PASS
BenchmarkUnquoteEasy 10000000 182 ns/op 0 B/op 0 allocs/op
BenchmarkUnquoteHard 1000000 1119 ns/op 192 B/op 2 allocs/op
ok github.com/im7mortal/benchcmp2 3.141s
Where yoshkarola
is separator.
3235f14078c462b38c4b79912c1e34c868d34049
is commit hash where file .benchHistory was changed last time.
Further is a standard output of go test -bench=. -benchmem
PASS
BenchmarkUnquoteEasy 10000000 182 ns/op 0 B/op 0 allocs/op
BenchmarkUnquoteHard 1000000 1119 ns/op 192 B/op 2 allocs/op
ok github.com/im7mortal/benchcmp2 3.141s
Authors
- Petr Lozhkin [email protected]
License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*Note that all licence references and agreements mentioned in the prettybenchcmp README section above
are relevant to that project's source code only.