Skip to content

Conversation

arnehormann
Copy link
Member

  • move benchmarks from driver_test.go into its own file
  • add benchmarks written by Brad Fitzpatrick to measure allocations

}

// Workaround to get Go 1.0 compatibility for Travis-CI
type AllocReporter interface {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current master is Go 1.1+ only

@arnehormann
Copy link
Member Author

PTAL

)

func initRoundtripBenchmarks() ([]byte, int, int) {
roundtripOnce.Do(func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you use a == nil check as before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because benchmarks could run concurrently and this is the only safe way to guard it... I think. I don't know, though. It's a new PR with old code. Should I change it to == nil?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure benchmarks don't run concurrently if not explicitly marked with http://golang.org/pkg/testing/#T.Parallel

@ghost ghost assigned arnehormann Sep 15, 2013
@arnehormann
Copy link
Member Author

PTAL

@julienschmidt
Copy link
Member

LGTM

arnehormann added a commit that referenced this pull request Sep 15, 2013
@arnehormann arnehormann merged commit 61e7183 into go-sql-driver:master Sep 15, 2013
@arnehormann arnehormann deleted the benchmarks branch September 15, 2013 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants