Skip to content

net: GoLookupIPNoSuchHost performance regression #25336

Closed
@quasilyte

Description

@quasilyte

Commit 672729e (https://golang.org/cl/37879) introduced performance regression for "no such host" case.

goos: linux
goarch: amd64
pkg: net
BenchmarkGoLookupIPNoSuchHost-4               30          43958216 ns/op
BenchmarkGoLookupIPNoSuchHost-4               30          43639313 ns/op
BenchmarkGoLookupIPNoSuchHost-4               30          58653180 ns/op
BenchmarkGoLookupIPNoSuchHost-4               30          49881501 ns/op
BenchmarkGoLookupIPNoSuchHost-4               30          52573745 ns/op

Before that commit:


goos: linux
goarch: amd64
pkg: net
BenchmarkGoLookupIPNoSuchHost-4             2000            681589 ns/op
BenchmarkGoLookupIPNoSuchHost-4             2000            717598 ns/op
BenchmarkGoLookupIPNoSuchHost-4             2000            688904 ns/op
BenchmarkGoLookupIPNoSuchHost-4             2000            690374 ns/op
BenchmarkGoLookupIPNoSuchHost-4             2000            780634 ns/op

In other words:

name                    old time/op  new time/op   delta
GoLookupIPNoSuchHost-4   712µs ±10%  53484µs ±11%  +7413.71%  (p=0.008 n=5+5)

Needs investigation.

Activity

changed the title [-]net: GoLookupIPNoSuchHost performance regressions[/-] [+]net: GoLookupIPNoSuchHost performance regression[/+] on May 10, 2018
odeke-em

odeke-em commented on May 10, 2018

@odeke-em
Member

Thank you for reporting this @quasilyte!

/cc @iangudger @bradfitz

added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on May 10, 2018
iangudger

iangudger commented on May 10, 2018

@iangudger
Contributor

That is a big jump. I will look into it. I will admit that I mostly optimized for the non-error case.

Edit: How do I run this benchmark?

quasilyte

quasilyte commented on May 10, 2018

@quasilyte
ContributorAuthor

@iangudger, the simplest way is go test -bench=GoLookupIPNoSuchHost net. Is this what you're asking? See also: benchstat.

added this to the Go1.11 milestone on May 11, 2018
iangudger

iangudger commented on May 17, 2018

@iangudger
Contributor

I have been able to reproduce the issue. I will start debugging.

iangudger

iangudger commented on May 18, 2018

@iangudger
Contributor

I found the issue. I will try to send out a fix and some benchmarks tomorrow.

added
NeedsFixThe path to resolution is known, but the work has not been done.
and removed
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on May 18, 2018
iangudger

iangudger commented on May 18, 2018

@iangudger
Contributor

Go 10.10.2:

BenchmarkGoLookupIP-12                        	   10000	    174883 ns/op   11450 B/op	     163 allocs/op
BenchmarkGoLookupIPNoSuchHost-12              	    3000	    670140 ns/op   52189 B/op	     544 allocs/op
BenchmarkGoLookupIPWithBrokenNameServer-12    	       1	5002568137 ns/op  163792 B/op	     375 allocs/op

tip:

BenchmarkGoLookupIP-12                        	   10000	    165501 ns/op    8585 B/op	      94 allocs/op
BenchmarkGoLookupIPNoSuchHost-12              	    1000	   1204117 ns/op   83661 B/op	     674 allocs/op
BenchmarkGoLookupIPWithBrokenNameServer-12    	       1	5002629186 ns/op  159128 B/op	     275 allocs/op

after patch:

BenchmarkGoLookupIP-12                        	   10000	    158102 ns/op    8585 B/op	      94 allocs/op
BenchmarkGoLookupIPNoSuchHost-12              	    2000	    645364 ns/op   42990 B/op	     356 allocs/op
BenchmarkGoLookupIPWithBrokenNameServer-12    	       1	5002163437 ns/op  159144 B/op	     275 allocs/op
gopherbot

gopherbot commented on May 18, 2018

@gopherbot
Contributor

Change https://golang.org/cl/113815 mentions this issue: net: fix DNS NXDOMAIN performance regression

gopherbot

gopherbot commented on Sep 6, 2018

@gopherbot
Contributor

Change https://golang.org/cl/133675 mentions this issue: net: fail fast for DNS rcode success with no answers of requested type

6 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @agnivade@odeke-em@quasilyte@iangudger@gopherbot

        Issue actions

          net: GoLookupIPNoSuchHost performance regression · Issue #25336 · golang/go