From c32e63239ed32c953c67c50d74065c36c2d7259b Mon Sep 17 00:00:00 2001 From: Evgeniy Stratonikov Date: Mon, 12 Jul 2021 14:32:56 +0300 Subject: [PATCH] CONTRIBUTING.md: add section for benchmarks Signed-off-by: Evgeniy Stratonikov --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index db72a29dd..b52001792 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,14 @@ follow the guidelines: [pull requests](https://github.com/nspcc-dev/neo-go/pulls) for existing discussions. 1. Open an issue first, to discuss a new feature or enhancement. 1. Write tests, and make sure the test suite passes locally and on CI. +1. When optimizing something, write benchmarks and attach results: + ``` + go test -run - -bench BenchmarkYourFeature -count=10 ./... >old // on master + go test -run - -bench BenchmarkYourFeature -count=10 ./... >new // on your branch + benchstat old new + ``` + `benchstat` is described here https://godocs.io/golang.org/x/perf/cmd/benchstat. + 1. Open a pull request, and reference the relevant issue(s). 1. Make sure your commits are logically separated and have good comments explaining the details of your change. Add a package/file prefix to your